mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
RedfishPkg: Add missing FreePool to fix memory leak issue
According to the implementation of `HiiGetSupportedLanguages`, the caller is responsible for freeing the returned string using FreePool(). Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
This commit is contained in:
parent
9b71501f6c
commit
2ff1029cc3
1 changed files with 6 additions and 0 deletions
|
|
@ -508,12 +508,16 @@ GetSupportedSchema (
|
|||
}
|
||||
|
||||
if (Count == 0) {
|
||||
FreePool (SupportedLanguages);
|
||||
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
SupportedSchema->Count = Count;
|
||||
SupportedSchema->SchemaList = AllocatePool (sizeof (CHAR8 *) * Count);
|
||||
if (SupportedSchema->SchemaList == NULL) {
|
||||
FreePool (SupportedLanguages);
|
||||
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
|
|
@ -539,6 +543,8 @@ GetSupportedSchema (
|
|||
++Index;
|
||||
}
|
||||
|
||||
FreePool (SupportedLanguages);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue