diff --git a/NetworkPkg/Dhcp6Dxe/Dhcp6Io.c b/NetworkPkg/Dhcp6Dxe/Dhcp6Io.c index 4f8393cb36..613b42149c 100644 --- a/NetworkPkg/Dhcp6Dxe/Dhcp6Io.c +++ b/NetworkPkg/Dhcp6Dxe/Dhcp6Io.c @@ -203,6 +203,7 @@ Dhcp6EnqueueRetry ( // // Unexpected message type. // + FreePool(TxCb); return EFI_DEVICE_ERROR; } diff --git a/NetworkPkg/Ip4Dxe/Ip4If.c b/NetworkPkg/Ip4Dxe/Ip4If.c index 53a333037f..348f2e076a 100644 --- a/NetworkPkg/Ip4Dxe/Ip4If.c +++ b/NetworkPkg/Ip4Dxe/Ip4If.c @@ -491,9 +491,13 @@ Ip4CreateInterface ( IP4_INTERFACE *Interface; EFI_SIMPLE_NETWORK_MODE SnpMode; + if (Mnp == NULL) { + return NULL; + } + Interface = AllocatePool (sizeof (IP4_INTERFACE)); - if ((Interface == NULL) || (Mnp == NULL)) { + if (Interface == NULL) { return NULL; } diff --git a/NetworkPkg/TcpDxe/TcpDispatcher.c b/NetworkPkg/TcpDxe/TcpDispatcher.c index 86beaf8cc5..9ae08ccc1c 100644 --- a/NetworkPkg/TcpDxe/TcpDispatcher.c +++ b/NetworkPkg/TcpDxe/TcpDispatcher.c @@ -390,6 +390,7 @@ TcpAttachPcb ( ); if (EFI_ERROR (Status)) { IpIoRemoveIp (IpIo, Tcb->IpInfo); + FreePool (Tcb); return Status; }