mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/3] calloc: Fix possible memory leak
@ 2013-10-21 17:48 Alexander Shiyan
  2013-10-21 17:48 ` [PATCH 2/3] gadget: at91: Fix uninitialized variable Alexander Shiyan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alexander Shiyan @ 2013-10-21 17:48 UTC (permalink / raw)
  To: barebox


Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 common/dlmalloc.c | 4 ++--
 1 file 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 {
-- 
1.8.1.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-10-22  6:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-21 17:48 [PATCH 1/3] calloc: Fix possible memory leak Alexander Shiyan
2013-10-21 17:48 ` [PATCH 2/3] gadget: at91: Fix uninitialized variable Alexander Shiyan
2013-10-21 17:48 ` [PATCH 3/3] ubifs: Remove redundant assignment Alexander Shiyan
2013-10-22  6:52 ` [PATCH 1/3] calloc: Fix possible memory leak Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox