diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2018-01-25 08:41:27 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-01-25 08:43:13 +0100 |
commit | 220e92bc20a74dd005ecf057d7de25e8db8b9b25 (patch) | |
tree | 400c24449a1db4fd518447afc633148ed6c6d478 /common | |
parent | e660e511ae29b914cfc47413f5ac1107c2da0693 (diff) | |
download | barebox-220e92bc20a74dd005ecf057d7de25e8db8b9b25.tar.gz barebox-220e92bc20a74dd005ecf057d7de25e8db8b9b25.tar.xz |
uimage: fix memory leak in error path
handle->name is dynamically allocated, so free it in the error path.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reported-by: Stefan Lengfeld <contact@stefanchrist.eu>
Diffstat (limited to 'common')
-rw-r--r-- | common/uimage.c | 2 |
1 files changed, 2 insertions, 0 deletions
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); |