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:
sfu5 2013-04-25 01:38:06 +00:00
parent 6879581d2e
commit 968e143192
1 changed files with 5 additions and 3 deletions

View File

@ -1,7 +1,7 @@
/** @file
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
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
@ -323,7 +323,7 @@ DestroyMenuEntry (
FileContext = (SECUREBOOT_FILE_CONTEXT *) MenuEntry->FileContext;
if (!FileContext->IsRoot) {
if (!FileContext->IsRoot && FileContext->DevicePath != NULL) {
FreePool (FileContext->DevicePath);
} else {
if (FileContext->FHandle != NULL) {
@ -340,7 +340,9 @@ DestroyMenuEntry (
FreePool (FileContext);
if (MenuEntry->DisplayString != NULL) {
FreePool (MenuEntry->DisplayString);
}
if (MenuEntry->HelpString != NULL) {
FreePool (MenuEntry->HelpString);
}