diff options
| author | Qihang Gao <gaoqihang@loongson.cn> | 2026-09-18 11:44:15 +0300 |
|---|---|---|
| committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2026-09-25 15:42:52 +0300 |
| commit | 0bdafe9fb28ffd54dbc1fe74659a491e57ebeadb (patch) | |
| tree | 71d1addf2edd4fe6cea434012169c1befe617ce2 /MdeModulePkg/Library | |
| parent | 76c4633bb7082abd9e54c3c829c1db4b5f3ee906 (diff) | |
| download | edk2-0bdafe9fb28ffd54dbc1fe74659a491e57ebeadb.tar.xz | |
MdeModulePkg/UefiHiiLib: Fix memory leaks in ValidateQuestionFromVfr
QuestionName is allocated by HiiGetString() but is not released in
several code path. This causes memory leaks whenever these paths are
taken.
Add FreePool (QuestionName) after it is no longer needed.
No functional change intended.
Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
Diffstat (limited to 'MdeModulePkg/Library')
| -rw-r--r-- | MdeModulePkg/Library/UefiHiiLib/HiiLib.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c index 18796aba72..2293a9e1ef 100644 --- a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c +++ b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c @@ -1378,10 +1378,12 @@ ValidateQuestionFromVfr ( //
// This question is not in the current configuration string. Skip it.
//
+ FreePool (QuestionName);
break;
}
Status = GetValueFromRequest (RequestElement, QuestionName, &VarValue);
+ FreePool (QuestionName);
if (EFI_ERROR (Status)) {
return Status;
}
@@ -1477,10 +1479,12 @@ ValidateQuestionFromVfr ( //
// This question is not in the current configuration string. Skip it.
//
+ FreePool (QuestionName);
break;
}
Status = GetValueFromRequest (RequestElement, QuestionName, &VarValue);
+ FreePool (QuestionName);
if (EFI_ERROR (Status)) {
return Status;
}
@@ -1672,10 +1676,12 @@ ValidateQuestionFromVfr ( //
// This question is not in the current configuration string. Skip it.
//
+ FreePool (QuestionName);
break;
}
Status = GetValueFromRequest (RequestElement, QuestionName, &VarValue);
+ FreePool (QuestionName);
if (EFI_ERROR (Status)) {
return Status;
}
@@ -1778,6 +1784,7 @@ ValidateQuestionFromVfr ( //
// This question is not in the current configuration string. Skip it.
//
+ FreePool (QuestionName);
break;
}
@@ -1785,6 +1792,7 @@ ValidateQuestionFromVfr ( // Skip the VarName.
//
StringPtr += StrLen (QuestionName);
+ FreePool (QuestionName);
//
// Skip the "=".
|
