Skip to content

Commit

Permalink
NetworkPkg/UefiPxeBcDxe: Bugfix for pxe driver
Browse files Browse the repository at this point in the history
Ensure the poniter is not null before free it

Signed-off-by: Bing Luo <[email protected]>
  • Loading branch information
Bing Luo committed Dec 31, 2024
1 parent 0986082 commit 094466f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
//
Expand Down Expand Up @@ -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) {
//
Expand Down

0 comments on commit 094466f

Please sign in to comment.