mirror of https://github.com/acidanthera/audk.git
NetworkPkg: Fix memory leak problem in PXE driver.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
This commit is contained in:
parent
9f4f29cbee
commit
2fad330f6b
|
@ -548,6 +548,7 @@ PxeBcExtractBootFileUrl (
|
|||
if (ModeStr != NULL && *(ModeStr + AsciiStrLen (";mode=octet")) == '\0') {
|
||||
*ModeStr = '\0';
|
||||
} else if (AsciiStrStr (BootFileNamePtr, ";mode=") != NULL) {
|
||||
FreePool (TmpStr);
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
|
@ -1005,7 +1006,7 @@ PxeBcRequestBootService (
|
|||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -1020,7 +1021,7 @@ PxeBcRequestBootService (
|
|||
//
|
||||
Status = Private->Udp6Read->Configure (Private->Udp6Read, &Private->Udp6CfgData);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
Status = PxeBc->UdpRead (
|
||||
|
@ -1041,7 +1042,7 @@ PxeBcRequestBootService (
|
|||
Private->Udp6Read->Configure (Private->Udp6Read, NULL);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -1050,6 +1051,13 @@ PxeBcRequestBootService (
|
|||
Reply->Length = (UINT32) ReadSize;
|
||||
|
||||
return EFI_SUCCESS;
|
||||
|
||||
ON_ERROR:
|
||||
if (Discover != NULL) {
|
||||
FreePool (Discover);
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
|
@ -2158,7 +2166,7 @@ PxeBcDhcp6Discover (
|
|||
(VOID *) Discover
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -2178,7 +2186,7 @@ PxeBcDhcp6Discover (
|
|||
//
|
||||
Status = Private->Udp6Read->Configure (Private->Udp6Read, &Private->Udp6CfgData);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
Status = PxeBc->UdpRead (
|
||||
|
@ -2198,10 +2206,17 @@ PxeBcDhcp6Discover (
|
|||
//
|
||||
Private->Udp6Read->Configure (Private->Udp6Read, NULL);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
|
||||
ON_ERROR:
|
||||
if (Discover != NULL) {
|
||||
FreePool (Discover);
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
Driver Binding functions implementationfor for UefiPxeBc Driver.
|
||||
|
||||
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
|
||||
Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2018, 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
|
||||
|
@ -254,6 +254,7 @@ PxeBcDestroyIp4Children (
|
|||
&Private->PxeBc,
|
||||
NULL
|
||||
);
|
||||
FreePool (Private->Ip4Nic->DevicePath);
|
||||
|
||||
if (Private->Snp != NULL) {
|
||||
//
|
||||
|
@ -414,6 +415,8 @@ PxeBcDestroyIp6Children (
|
|||
&Private->PxeBc,
|
||||
NULL
|
||||
);
|
||||
FreePool (Private->Ip6Nic->DevicePath);
|
||||
|
||||
if (Private->Snp != NULL) {
|
||||
//
|
||||
// Close SNP from the child virtual handle
|
||||
|
|
Loading…
Reference in New Issue