Skip to content

Commit

Permalink
OcAppleSecureBootLib: Fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
vit9696 committed Dec 25, 2022
1 parent 15a8d7f commit 6570a87
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Library/OcAppleSecureBootLib/OcAppleSecureBootLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ InternalGetImg4ByPath (
(VOID **)&FileSystem
);
if (EFI_ERROR (Status)) {
FreePool (Path);
return EFI_NO_MEDIA;
}

Expand Down Expand Up @@ -653,12 +654,14 @@ InternalGetImg4ByPath (
}

if (!Result) {
FreePool (Path);
Root->Close (Root);
return EFI_LOAD_ERROR;
}

ManifestBuffer = InternalReadFile (Root, Path, &ManifestSize);

FreePool (Path);
Root->Close (Root);

if (ManifestBuffer == NULL) {
Expand Down

0 comments on commit 6570a87

Please sign in to comment.