Skip to content

Commit 7543b8e

Browse files
wyjwangkevintraynor
authored andcommitted
netdev-offload-dpdk: Fix memory leak for matching fragments.
The error paths should release any allocated resources that are not added to the patterns. Found by Coverity. Fixes: c1a5d0e ("netdev-offload-dpdk: Support IPv4 fragmentation types.") Fixes: 1318929 ("netdev-offload-dpdk: Support IPv6 fragmentation types.") Signed-off-by: Yunjian Wang <[email protected]> Reviewed-by: David Marchand <[email protected]> Signed-off-by: Kevin Traynor <[email protected]>
1 parent 3b2f252 commit 7543b8e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/netdev-offload-dpdk.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,6 +1514,8 @@ parse_flow_match(struct netdev *netdev,
15141514
} else {
15151515
VLOG_WARN_RL(&rl, "Unknown IPv4 frag (0x%x/0x%x)",
15161516
match->flow.nw_frag, match->wc.masks.nw_frag);
1517+
free(spec);
1518+
free(mask);
15171519
return -1;
15181520
}
15191521
consumed_masks->nw_frag = 0;
@@ -1597,6 +1599,8 @@ parse_flow_match(struct netdev *netdev,
15971599
} else {
15981600
VLOG_WARN_RL(&rl, "Unknown IPv6 frag (0x%x/0x%x)",
15991601
match->flow.nw_frag, match->wc.masks.nw_frag);
1602+
free(frag_spec);
1603+
free(frag_mask);
16001604
return -1;
16011605
}
16021606

0 commit comments

Comments
 (0)