[ovs-dev] [PATCH 1/1] dpif: fix memory leak while dumping dpif flows

Damijan Skvarc damjan.skvarc at gmail.com
Wed Jan 22 14:06:43 UTC 2020


leak was detected by running test: "ofproto-dpif - balance-tcp bonding"

Signed-off-by: Damijan Skvarc <damjan.skvarc at gmail.com>
---
 ofproto/ofproto-dpif.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index d3cb392..e8c851e 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -6281,7 +6281,8 @@ ofproto_unixctl_dpif_dump_flows(struct unixctl_conn *conn,
     flow_dump_thread = dpif_flow_dump_thread_create(flow_dump);
     while (dpif_flow_dump_next(flow_dump_thread, &f, 1)) {
         struct flow flow;
-
+        /* no need for extra info */
+        free(f.attrs.dp_extra_info);
         if ((odp_flow_key_to_flow(f.key, f.key_len, &flow, NULL)
              == ODP_FIT_ERROR)
             || (xlate_lookup_ofproto(ofproto->backer, &flow, NULL, NULL)
-- 
2.7.4



More information about the dev mailing list