test-netflow: Fix memory leak reported by valgrind.
authorWilliam Tu <u9012063@gmail.com>
Wed, 6 Jan 2016 18:49:35 +0000 (10:49 -0800)
committerBen Pfaff <blp@ovn.org>
Mon, 11 Jan 2016 16:44:52 +0000 (08:44 -0800)
Test case 890: ofproto-dpif - NetFlow flow expiration - IPv4 collector
Valgrind reports two leaks below:
    unixctl_server_create (unixctl.c:250)
    test_netflow_main (test-netflow.c:200)
    ovstest_wrapper_test_netflow_main__ (test-netflow.c:301)
    ovs_cmdl_run_command (command-line.c:121)
    main (ovstest.c:132)
and
    ofpbuf_init (ofpbuf.c:124)
    test_netflow_main (test-netflow.c:208)
    ovstest_wrapper_test_netflow_main__ (test-netflow.c:301)
    ovs_cmdl_run_command (command-line.c:121)
    main (ovstest.c:132)

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Co-authored-by: Daniele Di Proietto <diproiettod@vmware.com
Signed-off-by: Ben Pfaff <blp@ovn.org>
tests/test-netflow.c

index 2abc57f..47d0f20 100644 (file)
@@ -233,6 +233,9 @@ test_netflow_main(int argc, char *argv[])
         unixctl_server_wait(server);
         poll_block();
     }
+
+    ofpbuf_uninit(&buf);
+    unixctl_server_destroy(server);
 }
 
 static void