From 272d9d0d9b29f41b6b10a870d856fec8d19233e2 Mon Sep 17 00:00:00 2001 From: Josef Moellers Date: Thu, 24 Jan 2019 09:16:49 +0100 Subject: [PATCH] hpm: Fix resource leak fclose(pImageFile) was missing before returning from HpmfwupgGetBufferFromFile() --- lib/ipmi_hpmfwupg.c | 1 + 1 file changed, 1 insertion(+) 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);