[Skiboot] [PATCH 10/13] libflash/test/test-flash.c: fix memory leak on exit

Stewart Smith stewart at linux.vnet.ibm.com
Wed Aug 23 17:21:20 AEST 2017


LeakSanitizer spotted this:

Direct leak of 131072 byte(s) in 1 object(s) allocated from:
    #0 0x7fb99e42b850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x408612 in main libflash/test/test-flash.c:380
    #2 0x7fb99d27d509 in __libc_start_main (/lib64/libc.so.6+0x20509)

Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>
---
 libflash/test/test-flash.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libflash/test/test-flash.c b/libflash/test/test-flash.c
index 3f77d6f3e840..3c04fd3beb71 100644
--- a/libflash/test/test-flash.c
+++ b/libflash/test/test-flash.c
@@ -454,6 +454,7 @@ int main(void)
 	printf("Test ECC erase pass\n");
 
 	flash_exit(bl);
+	free(test);
 
 	return 0;
 }
-- 
2.13.5



More information about the Skiboot mailing list