NetworkPkg/UefiPxeBcDxe: Bugfix for pxe driver

Ensure the poniter is not null before free it

Signed-off-by: Bing Luo <robin.luo@jaguarmicro.com>
This commit is contained in:
Bing Luo 2024-12-29 10:20:31 +08:00 committed by mergify[bot]
parent a2263cb201
commit 070eadb550
1 changed files with 6 additions and 2 deletions

View File

@ -246,7 +246,9 @@ PxeBcDestroyIp4Children (
&Private->PxeBc,
NULL
);
FreePool (Private->Ip4Nic->DevicePath);
if (Private->Ip4Nic->DevicePath != NULL) {
FreePool (Private->Ip4Nic->DevicePath);
}
if (Private->Snp != NULL) {
//
@ -407,7 +409,9 @@ PxeBcDestroyIp6Children (
&Private->PxeBc,
NULL
);
FreePool (Private->Ip6Nic->DevicePath);
if (Private->Ip6Nic->DevicePath != NULL) {
FreePool (Private->Ip6Nic->DevicePath);
}
if (Private->Snp != NULL) {
//