[ovs-dev] [PATCH 1/4] netdev-dpdk: Fix mp_name leak on snprintf failure.

Ilya Maximets i.maximets at samsung.com
Mon Oct 30 12:52:38 UTC 2017


CC: Robert Wojciechowicz <robertx.wojciechowicz at intel.com>
CC: Antonio Fischetti <antonio.fischetti at intel.com>
Fixes: d555d9bded5f ("netdev-dpdk: Create separate memory pool for each port.")
Fixes: 65056fd79694 ("netdev-dpdk: manage failure in mempool name creation.")
Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
---
 lib/netdev-dpdk.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 82652f0..1e9d78f 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -505,6 +505,7 @@ dpdk_mp_name(struct dpdk_mp *dmp)
         VLOG_DBG("snprintf returned %d. Failed to generate a mempool "
             "name for \"%s\". Hash:0x%x, mtu:%d, mbufs:%u.",
             ret, dmp->if_name, h, dmp->mtu, dmp->n_mbufs);
+        free(mp_name);
         return NULL;
     }
     return mp_name;
-- 
2.7.4



More information about the dev mailing list