[dpdk-dev] [PATCH v3 6/7] l3fwd-power: fix a memory leak for non-ip packet

Shaopeng He shaopeng.he at intel.com
Thu Nov 5 06:12:08 CET 2015


Previous l3fwd-power only processes IP and IPv6 packet, other
packet's mbuf is not released, and causes a memory leak.
This patch fixes this issue.

Signed-off-by: Shaopeng He <shaopeng.he at intel.com>
Acked-by: Jing Chen <jing.d.chen at intel.com>
---
 examples/l3fwd-power/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index 9175989..9c76d9e 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -714,7 +714,8 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid,
 		/* We don't currently handle IPv6 packets in LPM mode. */
 		rte_pktmbuf_free(m);
 #endif
-	}
+	} else
+		rte_pktmbuf_free(m);
 
 }
 
-- 
1.9.3



More information about the dev mailing list