diff options
author | Alexander Shiyan <shc_work@mail.ru> | 2013-10-21 21:48:23 +0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-10-22 08:51:44 +0200 |
commit | 5643fdce0f680fe8a6172e2605726fc974cd472b (patch) | |
tree | 2b1a46a0824e0b926eaf5f3b7ad87acc0beecc71 | |
parent | 6b8b04c0abebfc01de2cc9f869a3327bb888b666 (diff) | |
download | barebox-5643fdce0f680fe8a6172e2605726fc974cd472b.tar.gz barebox-5643fdce0f680fe8a6172e2605726fc974cd472b.tar.xz |
calloc: Fix possible memory leak
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | common/dlmalloc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/dlmalloc.c b/common/dlmalloc.c index 7ad368ee53..b4341fef54 100644 --- a/common/dlmalloc.c +++ b/common/dlmalloc.c @@ -1750,11 +1750,11 @@ void *calloc(size_t n, size_t elem_size) mchunkptr oldtop = top; INTERNAL_SIZE_T oldtopsize = chunksize(top); - void *mem = malloc(sz); - if ((long)n < 0) return NULL; + void *mem = malloc(sz); + if (!mem) return NULL; else { |