Explorar o código

__uc_malloc: Fix memory-leak in error path

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer %!s(int64=14) %!d(string=hai) anos
pai
achega
025ec197fe
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  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);
 	}
 }