Counters in ops->custom_stats may already be valid at this error point.
This patch frees the leaked memory.

Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10322
Signed-off-by: Yifeng Sun <[email protected]>
---
 lib/ofp-port.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/ofp-port.c b/lib/ofp-port.c
index 3d1ada9ceb99..15dac4f0ac2e 100644
--- a/lib/ofp-port.c
+++ b/lib/ofp-port.c
@@ -1679,6 +1679,7 @@ ofputil_pull_ofp14_port_stats(struct ofputil_port_stats 
*ops,
 
         error = ofpprop_pull(&properties, &payload, &type);
         if (error) {
+            netdev_free_custom_stats_counters(&ops->custom_stats);
             return error;
         }
         switch (type) {
-- 
2.7.4

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

Reply via email to