Skip to content

Commit

Permalink
test-sflow: Fix memory leak in main function.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
igsilya authored and blp committed Jan 4, 2016
1 parent 5077bbe commit d1a74e5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/test-sflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d1a74e5

Please sign in to comment.