summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosef Moellers <jmoellers@suse.de>2019-01-24 09:16:49 +0100
committerAlexander Amelkin <mocbuhtig@amelkin.msk.ru>2019-01-24 15:22:21 +0300
commit272d9d0d9b29f41b6b10a870d856fec8d19233e2 (patch)
treec7c2977d838543c480e480297b897de06d60ceb4
parent0ca9c66b84a9e20a941d44314070601d7fe16aa6 (diff)
downloadipmitool-272d9d0d9b29f41b6b10a870d856fec8d19233e2.tar.gz
hpm: Fix resource leak
fclose(pImageFile) was missing before returning from HpmfwupgGetBufferFromFile()
-rw-r--r--lib/ipmi_hpmfwupg.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/ipmi_hpmfwupg.c b/lib/ipmi_hpmfwupg.c
index ac1d90f..4783eec 100644
--- a/lib/ipmi_hpmfwupg.c
+++ b/lib/ipmi_hpmfwupg.c
@@ -1398,6 +1398,7 @@ HpmfwupgGetBufferFromFile(char *imageFilename,
if (ret != 0) {
lprintf(LOG_ERR, "Failed to seek in the image file '%s'",
imageFilename);
+ fclose(pImageFile);
return HPMFWUPG_ERROR;
}
pFwupgCtx->imageSize = ftell(pImageFile);