diff options
author | Vincent Labrecque <vincent@cvs.openbsd.org> | 2002-07-03 03:48:00 +0000 |
---|---|---|
committer | Vincent Labrecque <vincent@cvs.openbsd.org> | 2002-07-03 03:48:00 +0000 |
commit | 93345487e145c07cae35392d6302b3a01ffb6616 (patch) | |
tree | aab9870b6078624163ed39df6cc34b7a1493ff47 /usr.bin/mg/extend.c | |
parent | 21d2026709fc9f32e3b9ee2af9465fb459c2bb4f (diff) |
a few missing tests for malloc()'s return value.
ok art@
Diffstat (limited to 'usr.bin/mg/extend.c')
-rw-r--r-- | usr.bin/mg/extend.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/mg/extend.c b/usr.bin/mg/extend.c index 43626488f20..67b764b0633 100644 --- a/usr.bin/mg/extend.c +++ b/usr.bin/mg/extend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: extend.c,v 1.27 2002/07/01 14:33:44 vincent Exp $ */ +/* $OpenBSD: extend.c,v 1.28 2002/07/03 03:47:59 vincent Exp $ */ /* * Extended (M-X) commands, rebinding, and startup file processing. @@ -189,9 +189,9 @@ remap(KEYMAP *curmap, /* pointer to the map being changed */ if (pref_map != NULL) ele->k_prefmap = pref_map; else { - if (!(mp = malloc(sizeof(KEYMAP) + + if ((mp = malloc(sizeof(KEYMAP) + (MAPINIT - 1) * - sizeof(MAP_ELEMENT)))) { + sizeof(MAP_ELEMENT))) == NULL) { ewprintf("Out of memory"); ele->k_funcp[c - ele->k_base] = curmap->map_default; |