[Skiboot] [PATCH v2 01/10] external/common: Don't leak temporary filename

Cyril Bur cyril.bur at au1.ibm.com
Wed Nov 11 15:39:55 AEDT 2015


Signed-off-by: Cyril Bur <cyril.bur at au1.ibm.com>
---
 external/common/arch_flash_powerpc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/external/common/arch_flash_powerpc.c b/external/common/arch_flash_powerpc.c
index 53c14ce..0cc7107 100644
--- a/external/common/arch_flash_powerpc.c
+++ b/external/common/arch_flash_powerpc.c
@@ -192,7 +192,7 @@ static struct blocklevel_device *arch_init_blocklevel(const char *file)
 {
 	int rc;
 	struct blocklevel_device *new_bl = NULL;
-	char *real_file;
+	char *real_file = NULL;
 
 	if (!file) {
 		rc = get_dev_mtd(FDT_FLASH_PATH, &real_file);
@@ -201,6 +201,7 @@ static struct blocklevel_device *arch_init_blocklevel(const char *file)
 	}
 
 	file_init_path(file ? file : real_file, NULL, &new_bl);
+	free(real_file);
 	return new_bl;
 }
 
-- 
2.6.2



More information about the Skiboot mailing list