diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/ubootenv.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/scripts/ubootenv.c b/scripts/ubootenv.c index 02d4124195..dda5c4cb26 100644 --- a/scripts/ubootenv.c +++ b/scripts/ubootenv.c @@ -11,7 +11,17 @@ #include <string.h> #include <getopt.h> -#define xmalloc malloc +void *xmalloc(size_t size) +{ + void *p = NULL; + + if (!(p = malloc(size))) { + printf("ERROR: out of memory\n"); + exit(1); + } + + return p; +} #include "../include/envfs.h" #include "../common/environment.c" |