Skip to content

Commit

Permalink
RedfishClientPkg/Bios: fix leak of GetPendingSettings URI.
Browse files Browse the repository at this point in the history
Cc: Abner Chang <[email protected]>
Cc: Nickle Wang <[email protected]>
Cc: Igor Kulchytskyy <[email protected]>
Signed-off-by: Mike Maslenkin <[email protected]>
Reviewed-by: Abner Chang <[email protected]>
Reviewed-by: Nickle Wang <[email protected]>
  • Loading branch information
ghbaccount committed Feb 21, 2024
1 parent 7110d17 commit 181dfc0
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,13 @@ RedfishResourceConsumeResource (
// Check and see if "@Redfish.Settings" exist or not.
//
ZeroMem (&PendingSettingResponse, sizeof (REDFISH_RESPONSE));
Status = GetPendingSettings (
Private->RedfishService,
Response.Payload,
&PendingSettingResponse,
&PendingSettingUri
);
PendingSettingUri = NULL;
Status = GetPendingSettings (
Private->RedfishService,
Response.Payload,
&PendingSettingResponse,
&PendingSettingUri
);
if (!EFI_ERROR (Status)) {
DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n", __func__, PendingSettingUri));
Private->Uri = PendingSettingUri;
Expand Down Expand Up @@ -206,6 +207,10 @@ RedfishResourceConsumeResource (
FreePool (Etag);
}

if (PendingSettingUri != NULL) {
FreePool (PendingSettingUri);
}

return Status;
}

Expand Down

0 comments on commit 181dfc0

Please sign in to comment.