Skip to content

Commit 42c91d4

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 594afe8 commit 42c91d4

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
@@ -1526,6 +1526,8 @@ parse_flow_match(struct netdev *netdev,
15261526
} else {
15271527
VLOG_WARN_RL(&rl, "Unknown IPv4 frag (0x%x/0x%x)",
15281528
match->flow.nw_frag, match->wc.masks.nw_frag);
1529+
free(spec);
1530+
free(mask);
15291531
return -1;
15301532
}
15311533
consumed_masks->nw_frag = 0;
@@ -1609,6 +1611,8 @@ parse_flow_match(struct netdev *netdev,
16091611
} else {
16101612
VLOG_WARN_RL(&rl, "Unknown IPv6 frag (0x%x/0x%x)",
16111613
match->flow.nw_frag, match->wc.masks.nw_frag);
1614+
free(frag_spec);
1615+
free(frag_mask);
16121616
return -1;
16131617
}
16141618

0 commit comments

Comments
 (0)