Check if OvsAllocatememoryWithTag succeeded or not. In case of failure propagate cleanup and return.
Signed-off-by: Paul-Daniel Boca <[email protected]> --- datapath-windows/ovsext/Stt.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/datapath-windows/ovsext/Stt.c b/datapath-windows/ovsext/Stt.c index 0bac5f2..e63211d 100644 --- a/datapath-windows/ovsext/Stt.c +++ b/datapath-windows/ovsext/Stt.c @@ -641,6 +641,9 @@ OvsSttReassemble(POVS_SWITCH_CONTEXT switchContext, POVS_STT_PKT_ENTRY entry; entry = OvsAllocateMemoryWithTag(sizeof(OVS_STT_PKT_ENTRY), OVS_STT_POOL_TAG); + if (NULL == entry) { + goto handle_error; + } RtlZeroMemory(entry, sizeof (OVS_STT_PKT_ENTRY)); /* Update Key, timestamp and recvdLen */ @@ -663,6 +666,10 @@ OvsSttReassemble(POVS_SWITCH_CONTEXT switchContext, entry->allocatedLen = innerPacketLen; entry->packetBuf = OvsAllocateMemoryWithTag(innerPacketLen, OVS_STT_POOL_TAG); + if (NULL == entry->packetBuf) { + OvsFreeMemoryWithTag(pktFragEntry, OVS_STT_POOL_TAG); + goto handle_error; + } if (OvsGetPacketBytes(curNbl, fragmentLength, startOffset, entry->packetBuf + offset) == NULL) { OVS_LOG_ERROR("Error when obtaining bytes from Packet"); -- 2.7.2.windows.1 _______________________________________________ dev mailing list [email protected] http://openvswitch.org/mailman/listinfo/dev
