[ovs-dev] [PATCH] test-sflow: Fix memory leak in main function.

Ilya Maximets i.maximets at samsung.com
Thu Dec 24 10:22:53 UTC 2015


Reported by valgrind on test case 886.

 912 (24 direct, 888 indirect) bytes in 1 blocks are definitely lost
    at malloc
    by xmalloc (util.c:112)
    by unixctl_server_create (unixctl.c:250)
    by test_sflow_main (test-sflow.c:688)
    by ovstest_wrapper_test_sflow_main__ (test-sflow.c:786)
    by ovs_cmdl_run_command (command-line.c:121)
    by main (ovstest.c:132)

 1,500 bytes in 1 blocks are definitely lost
    at malloc
    by xmalloc (util.c:112)
    by ofpbuf_init (ofpbuf.c:124)
    by test_sflow_main (test-sflow.c:696)
    by ovstest_wrapper_test_sflow_main__ (test-sflow.c:786)
    by ovs_cmdl_run_command (command-line.c:121)
    by main (ovstest.c:132)

Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
---
 tests/test-sflow.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/test-sflow.c b/tests/test-sflow.c
index 08591bf..e18532f 100644
--- a/tests/test-sflow.c
+++ b/tests/test-sflow.c
@@ -717,6 +717,8 @@ test_sflow_main(int argc, char *argv[])
         unixctl_server_wait(server);
         poll_block();
     }
+    ofpbuf_uninit(&buf);
+    unixctl_server_destroy(server);
 }
 
 static void
-- 
2.1.4




More information about the dev mailing list