mirror of https://github.com/acidanthera/audk.git
Check for NULL pointer before free it.
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Dong Guo <guo.dong@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14316 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
6879581d2e
commit
968e143192
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
Internal file explorer functions for SecureBoot configuration module.
|
Internal file explorer functions for SecureBoot configuration module.
|
||||||
|
|
||||||
Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2012 - 2013, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -323,7 +323,7 @@ DestroyMenuEntry (
|
||||||
|
|
||||||
FileContext = (SECUREBOOT_FILE_CONTEXT *) MenuEntry->FileContext;
|
FileContext = (SECUREBOOT_FILE_CONTEXT *) MenuEntry->FileContext;
|
||||||
|
|
||||||
if (!FileContext->IsRoot) {
|
if (!FileContext->IsRoot && FileContext->DevicePath != NULL) {
|
||||||
FreePool (FileContext->DevicePath);
|
FreePool (FileContext->DevicePath);
|
||||||
} else {
|
} else {
|
||||||
if (FileContext->FHandle != NULL) {
|
if (FileContext->FHandle != NULL) {
|
||||||
|
@ -340,7 +340,9 @@ DestroyMenuEntry (
|
||||||
|
|
||||||
FreePool (FileContext);
|
FreePool (FileContext);
|
||||||
|
|
||||||
FreePool (MenuEntry->DisplayString);
|
if (MenuEntry->DisplayString != NULL) {
|
||||||
|
FreePool (MenuEntry->DisplayString);
|
||||||
|
}
|
||||||
if (MenuEntry->HelpString != NULL) {
|
if (MenuEntry->HelpString != NULL) {
|
||||||
FreePool (MenuEntry->HelpString);
|
FreePool (MenuEntry->HelpString);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue