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

Message ID 1445831265-14256-7-git-send-email-shaopeng.he@intel.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

He, Shaopeng Oct. 26, 2015, 3:47 a.m. UTC
  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@intel.com>
---
 examples/l3fwd-power/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Patch

diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index 8bb88ce..ecdff73 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);
 
 }