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