firmware-utils/mkfwimage: fix possible memory and resource leak
authorAndrea Dalla Costa <andrea@dallacosta.me>
Sat, 11 Jan 2020 22:27:17 +0000 (23:27 +0100)
committerJo-Philipp Wich <jo@mein.io>
Tue, 14 Jan 2020 16:48:50 +0000 (17:48 +0100)
commitb886d3c8f3d852a5d5bfcb41f439a808d9aa2d58
treef39ac6a3aa7675112bf303f962a0b35e62b8d77e
parent8e3b3152e5402b574ff66b149cfdc6e42d61db54
firmware-utils/mkfwimage: fix possible memory and resource leak

Add missing calls to `free` for variable `mem`.
Add missing call to `fclose` for variable `f`.

The same changes were made in both `mkfwimage.c` and `mkfwimage2.c`.

Signed-off-by: Andrea Dalla Costa <andrea@dallacosta.me>
tools/firmware-utils/src/mkfwimage.c
tools/firmware-utils/src/mkfwimage2.c