Browse Source

__uc_malloc: Fix memory-leak in error path

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer 13 years ago
parent
commit
025ec197fe
1 changed files with 1 additions and 0 deletions
  1. 1 0
      libc/stdlib/__uc_malloc.c

+ 1 - 0
libc/stdlib/__uc_malloc.c

@@ -39,6 +39,7 @@ void *__uc_malloc(size_t size)
 			return p;
 		if (!__uc_malloc_failed)
 			_exit(1);
+		free(p);
 		__uc_malloc_failed(size);
 	}
 }