[ovs-dev] [PATCH 2/3] ofp-print: Fix memory leak in ofp_print_queue_get_config_reply().

Yi-Hung Wei yihung.wei at gmail.com
Mon Nov 21 21:42:40 UTC 2016


In testcase "OFPT_QUEUE_GET_CONFIG_REPLY - OF1.0", valgrind reports a memory
leak with the following call stack.
    xrealloc (util.c:123)
    ofp_print_queue_get_config_reply (ofp-print.c:1233)
    ofp_to_string__ (ofp-print.c:3458)
    ofp_to_string (ofp-print.c:3681)
    ofp_print (ofp-print.c:3713)
    ofctl_ofp_print (ovs-ofctl.c:4399)
    ovs_cmdl_run_command__ (command-line.c:115)
    main (ovs-ofctl.c:151)

Signed-off-by: Yi-Hung Wei <yihung.wei at gmail.com>
---
 lib/ofp-print.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/ofp-print.c b/lib/ofp-print.c
index b7b5290..7b7c430 100644
--- a/lib/ofp-print.c
+++ b/lib/ofp-print.c
@@ -1263,6 +1263,7 @@ ofp_print_queue_get_config_reply(struct ds *string,
         ofp_print_error(string, retval);
     }
     ds_chomp(string, ' ');
+    free(queues);
 }
 
 static void
-- 
2.7.4



More information about the dev mailing list