hpm: Fix resource leak

fclose(pImageFile) was missing before returning from
HpmfwupgGetBufferFromFile()
This commit is contained in:
Josef Moellers 2019-01-24 09:16:49 +01:00 committed by Alexander Amelkin
parent 0ca9c66b84
commit 272d9d0d9b

View File

@ -1398,6 +1398,7 @@ HpmfwupgGetBufferFromFile(char *imageFilename,
if (ret != 0) { if (ret != 0) {
lprintf(LOG_ERR, "Failed to seek in the image file '%s'", lprintf(LOG_ERR, "Failed to seek in the image file '%s'",
imageFilename); imageFilename);
fclose(pImageFile);
return HPMFWUPG_ERROR; return HPMFWUPG_ERROR;
} }
pFwupgCtx->imageSize = ftell(pImageFile); pFwupgCtx->imageSize = ftell(pImageFile);