[ovs-dev] [PATCH 1/3] ovs-ofctl: Fix memory leak in ofctl_packet_out().

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


In testcase "bfd - bfd decay", valgrind reports a memory leak with the
following call stack.
    xmalloc (util.c:112)
    vconn_stream_new (vconn-stream.c:60)
    vconn_stream_open (vconn-stream.c:85)
    vconn_open (vconn.c:248)
    open_vconn_socket (ovs-ofctl.c:517)
    open_vconn__ (ovs-ofctl.c:553)
    open_vconn (ovs-ofctl.c:587)
    open_vconn_for_flow_mod (ovs-ofctl.c:1416)
    ofctl_packet_out (ovs-ofctl.c:2148)
    ovs_cmdl_run_command__ (command-line.c:115)
    main (ovs-ofctl.c:151)

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

diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
index 4b8a43c..29b324b 100644
--- a/utilities/ovs-ofctl.c
+++ b/utilities/ovs-ofctl.c
@@ -2149,6 +2149,7 @@ ofctl_packet_out(struct ovs_cmdl_context *ctx)
                                            usable_protocols);
         opo = ofputil_encode_packet_out(&po, protocol);
         transact_noreply(vconn, opo);
+        vconn_close(vconn);
         free(CONST_CAST(void *, po.packet));
         free(po.ofpacts);
     } else {
-- 
2.7.4



More information about the dev mailing list