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,19 +615,21 @@ HttpBootIp4DxeDriverBindingStart (
return EFI_SUCCESS; return EFI_SUCCESS;
ON_ERROR: ON_ERROR:
if (FirstStart) { if (Private != NULL) {
gBS->UninstallProtocolInterface ( if (FirstStart) {
ControllerHandle, gBS->UninstallProtocolInterface (
&gEfiCallerIdGuid, ControllerHandle,
&Private->Id &gEfiCallerIdGuid,
); &Private->Id
} );
}
HttpBootDestroyIp4Children (This, Private);
HttpBootConfigFormUnload (Private); HttpBootDestroyIp4Children (This, Private);
HttpBootConfigFormUnload (Private);
if (FirstStart && Private != NULL) { if (FirstStart) {
FreePool (Private); FreePool (Private);
}
} }
return Status; return Status;
@ -1144,19 +1146,21 @@ HttpBootIp6DxeDriverBindingStart (
return EFI_SUCCESS; return EFI_SUCCESS;
ON_ERROR: ON_ERROR:
if (FirstStart) { if (Private != NULL) {
gBS->UninstallProtocolInterface ( if (FirstStart) {
ControllerHandle, gBS->UninstallProtocolInterface (
&gEfiCallerIdGuid, ControllerHandle,
&Private->Id &gEfiCallerIdGuid,
); &Private->Id
} );
}
HttpBootDestroyIp6Children(This, Private); HttpBootDestroyIp6Children(This, Private);
HttpBootConfigFormUnload (Private); HttpBootConfigFormUnload (Private);
if (FirstStart && Private != NULL) { if (FirstStart) {
FreePool (Private); FreePool (Private);
}
} }
return Status; return Status;