[ovs-dev] [PATCH] ofp-port: Free memory on error in ofp_print_ofpst_port_reply

Yifeng Sun pkusunyifeng at gmail.com
Thu Oct 18 21:10:47 UTC 2018


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 <pkusunyifeng at gmail.com>
---
 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



More information about the dev mailing list