NetworkPkg/HttpBootDxe: Add check to avoid use NULL pointer

Cc: Wu Hao A <hao.a.wu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
This commit is contained in:
Jiaxin Wu 2017-10-27 10:16:29 +08:00
parent 76fd5a660d
commit 770f9aae09
1 changed files with 27 additions and 23 deletions

View File

@ -615,6 +615,7 @@ HttpBootIp4DxeDriverBindingStart (
return EFI_SUCCESS;
ON_ERROR:
if (Private != NULL) {
if (FirstStart) {
gBS->UninstallProtocolInterface (
ControllerHandle,
@ -626,9 +627,10 @@ ON_ERROR:
HttpBootDestroyIp4Children (This, Private);
HttpBootConfigFormUnload (Private);
if (FirstStart && Private != NULL) {
if (FirstStart) {
FreePool (Private);
}
}
return Status;
}
@ -1144,6 +1146,7 @@ HttpBootIp6DxeDriverBindingStart (
return EFI_SUCCESS;
ON_ERROR:
if (Private != NULL) {
if (FirstStart) {
gBS->UninstallProtocolInterface (
ControllerHandle,
@ -1155,9 +1158,10 @@ ON_ERROR:
HttpBootDestroyIp6Children(This, Private);
HttpBootConfigFormUnload (Private);
if (FirstStart && Private != NULL) {
if (FirstStart) {
FreePool (Private);
}
}
return Status;
}