OSDN Git Service

__uc_malloc: Fix memory-leak in error path
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Tue, 10 May 2011 18:09:36 +0000 (20:09 +0200)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Tue, 10 May 2011 18:09:36 +0000 (20:09 +0200)
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
libc/stdlib/__uc_malloc.c

index 2a2e223..449f014 100644 (file)
@@ -39,6 +39,7 @@ void *__uc_malloc(size_t size)
                        return p;
                if (!__uc_malloc_failed)
                        _exit(1);
+               free(p);
                __uc_malloc_failed(size);
        }
 }