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:
Qihang Gao 2025-10-28 11:22:12 +08:00 committed by mergify[bot]
parent 9b71501f6c
commit 2ff1029cc3

View file

@ -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;
}