ipmitool/hpm-Fix-resource-leak.patch

27 lines
760 B
Diff
Raw Normal View History

2019-09-30 10:53:18 -04:00
From 272d9d0d9b29f41b6b10a870d856fec8d19233e2 Mon Sep 17 00:00:00 2001
From: Josef Moellers <jmoellers@suse.de>
Date: Thu, 24 Jan 2019 09:16:49 +0100
Subject: [PATCH 095/119] 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);
--
2.19.1