소스 검색

__uc_malloc: Fix memory-leak in error path

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer 14 년 전
부모
커밋
025ec197fe
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  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);
 	}
 }