[PATCH 5/8] uimage: fix memory leak in error path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



handle->name is dynamically allocated, so free it in the error path.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
Reported-by: Stefan Lengfeld <contact@xxxxxxxxxxxxxxx>
---
 common/uimage.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/common/uimage.c b/common/uimage.c
index b6f0f109ca..e857c11d37 100644
--- a/common/uimage.c
+++ b/common/uimage.c
@@ -202,6 +202,8 @@ again:
 	return handle;
 err_out:
 	close(fd);
+
+	free(handle->name);
 	free(handle);
 	if (IS_BUILTIN(CONFIG_FS_TFTP) && !stat(uimage_tmp, &s))
 		unlink(uimage_tmp);
-- 
2.15.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux