The error paths should release any allocated resources.

Found by Coverity.

Fixes: c1a5d0e2b573 ("netdev-offload-dpdk: Support IPv4 fragmentation types.")
Signed-off-by: Yunjian Wang <[email protected]>
Reviewed-by: David Marchand <[email protected]>
---
v2: Update commit title suggested by David Marchand
---
 lib/netdev-offload-dpdk.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c
index 6ca271489..07f60106c 100644
--- a/lib/netdev-offload-dpdk.c
+++ b/lib/netdev-offload-dpdk.c
@@ -1526,6 +1526,8 @@ parse_flow_match(struct netdev *netdev,
             } else {
                 VLOG_WARN_RL(&rl, "Unknown IPv4 frag (0x%x/0x%x)",
                              match->flow.nw_frag, match->wc.masks.nw_frag);
+                free(spec);
+                free(mask);
                 return -1;
             }
             consumed_masks->nw_frag = 0;
@@ -1609,6 +1611,8 @@ parse_flow_match(struct netdev *netdev,
             } else {
                 VLOG_WARN_RL(&rl, "Unknown IPv6 frag (0x%x/0x%x)",
                              match->flow.nw_frag, match->wc.masks.nw_frag);
+                free(frag_spec);
+                free(frag_mask);
                 return -1;
             }
 
-- 
2.33.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to