]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_pdump/rte_pdump.c
pdump: fix possible mbuf leak on failure
[dpdk.git] / lib / librte_pdump / rte_pdump.c
index e6182d35c5aa57411322786adfa6e06c8c1a3319..fec49b525f7421f5b5c77b69bb98736d3c714d7f 100644 (file)
@@ -153,6 +153,8 @@ pdump_pktmbuf_copy(struct rte_mbuf *m, struct rte_mempool *mp)
        do {
                nseg++;
                if (pdump_pktmbuf_copy_data(seg, m) < 0) {
+                       if (seg != m_dup)
+                               rte_pktmbuf_free_seg(seg);
                        rte_pktmbuf_free(m_dup);
                        return NULL;
                }