From d1a74e5e4ff438f805e94ead2440c5f3fa56ffdc Mon Sep 17 00:00:00 2001 From: Ilya Maximets Date: Thu, 24 Dec 2015 13:22:53 +0300 Subject: [PATCH] test-sflow: Fix memory leak in main function. 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 Signed-off-by: Ben Pfaff --- tests/test-sflow.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test-sflow.c b/tests/test-sflow.c index 08591bf1a..e18532f86 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.20.1