From: Christian Storm <
christi...@siemens.com>
File handle tmp is Open()'d but not Close()'d on the Read()
error condition path, resulting in a file handle leak.
Fix it by calling Close() on this error exit path.
Signed-off-by: Christian Storm <
christi...@siemens.com>
---
utils.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/utils.c b/utils.c
index 42ff741..80801b7 100644
--- a/utils.c
+++ b/utils.c
@@ -94,6 +94,7 @@ CHAR16 *get_volume_custom_label(EFI_FILE_HANDLE fh)
}
status = uefi_call_wrapper(tmp->Read, 3, tmp, &buffsize, buffer);
if (status != EFI_SUCCESS) {
+ (VOID)uefi_call_wrapper(fh->Close, 1, tmp);
(VOID)FreePool(buffer);
return NULL;
}
--
2.32.0