This will result in a memory leak, comments inline. Thanks, Shashank
________________________________________ From: [email protected] <[email protected]> on behalf of Alin Serdean <[email protected]> Sent: Thursday, July 13, 2017 9:40 PM To: [email protected] Subject: [ovs-dev] [PATCH 05/40] datapath-windows: Fix possible NULL dereference in IpFragment If we can't allocate the NBL just return. Found using WDK 10 static code analysis. Signed-off-by: Alin Gabriel Serdean <[email protected]> --- datapath-windows/ovsext/IpFragment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datapath-windows/ovsext/IpFragment.c b/datapath-windows/ovsext/IpFragment.c index e601a15..eb278ef 100644 --- a/datapath-windows/ovsext/IpFragment.c +++ b/datapath-windows/ovsext/IpFragment.c @@ -205,7 +205,7 @@ OvsIpv4Reassemble(POVS_SWITCH_CONTEXT switchContext, *newNbl = OvsAllocateNBLFromBuffer(switchContext, packetBuf, packetLen); if (*newNbl == NULL) { OVS_LOG_ERROR("Insufficient resources, failed to allocate newNbl"); - status = NDIS_STATUS_RESOURCES; + return NDIS_STATUS_RESOURCES; ---- This will result in a memory leak because packetBuf is allocated above and not freed yet. packetBuf = (CHAR*)OvsAllocateMemoryWithTag(packetLen, OVS_IPFRAG_POOL_TAG); } /* Complete the fragment NBL */ -- _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
