summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2007-07-05 18:01:52 +0200
committerSascha Hauer <sha@octopus.labnet.pengutronix.de>2007-07-05 18:01:52 +0200
commitf4034495054f3b0d32f4fdf1eb259c36662ebed1 (patch)
treef0dcdd76d821cf1b84468c5b3e88d3912acd4c3c /scripts
parent97327a1b05bd8963c2331d32fa3de3257d2539d0 (diff)
downloadbarebox-f4034495054f3b0d32f4fdf1eb259c36662ebed1.tar.gz
barebox-f4034495054f3b0d32f4fdf1eb259c36662ebed1.tar.xz
svn_rev_423
Diffstat (limited to 'scripts')
-rw-r--r--scripts/ubootenv.c12
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"