summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c
index 6030a824aa..ba7082e985 100644
--- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c
+++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c
@@ -1516,8 +1516,10 @@ DhcpOnTimerTick (
Status = DhcpChooseOffer (DhcpSb);
if (EFI_ERROR(Status)) {
- FreePool (DhcpSb->LastOffer);
- DhcpSb->LastOffer = NULL;
+ if (DhcpSb->LastOffer != NULL) {
+ FreePool (DhcpSb->LastOffer);
+ DhcpSb->LastOffer = NULL;
+ }
} else {
goto ON_EXIT;
}