summaryrefslogtreecommitdiffstats
path: root/common/dlmalloc.c
diff options
context:
space:
mode:
authorAlexander Shiyan <shc_work@mail.ru>2013-10-21 21:48:23 +0400
committerSascha Hauer <s.hauer@pengutronix.de>2013-10-22 08:51:44 +0200
commit5643fdce0f680fe8a6172e2605726fc974cd472b (patch)
tree2b1a46a0824e0b926eaf5f3b7ad87acc0beecc71 /common/dlmalloc.c
parent6b8b04c0abebfc01de2cc9f869a3327bb888b666 (diff)
downloadbarebox-5643fdce0f680fe8a6172e2605726fc974cd472b.tar.gz
calloc: Fix possible memory leak
Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/dlmalloc.c')
-rw-r--r--common/dlmalloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index 7ad368e..b4341fe 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 {