summaryrefslogtreecommitdiff
path: root/NetworkPkg
diff options
context:
space:
mode:
Diffstat (limited to 'NetworkPkg')
-rw-r--r--NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c b/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c
index 0b2743d127..8ee831f521 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c
@@ -1353,9 +1353,6 @@ ON_ERROR:
&gEfiCallerIdGuid,
&Private->Id
);
- if (Private != NULL) {
- FreePool (Private);
- }
}
if (IpVersion == IP_VERSION_4) {
@@ -1364,6 +1361,10 @@ ON_ERROR:
PxeBcDestroyIp6Children (This, Private);
}
+ if (FirstStart && Private != NULL) {
+ FreePool (Private);
+ }
+
return Status;
}