Skip to content

Commit

Permalink
Fix memory leaks in iperf_reset_test().
Browse files Browse the repository at this point in the history
Submitted by:	Susant Sahani <ssahani@redhat.com>
  • Loading branch information
bmah888 committed Jan 3, 2014
1 parent 0b9ba10 commit c7ddeba
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/iperf_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1614,12 +1614,25 @@ iperf_reset_test(struct iperf_test *test)
test->omit = OMIT;
test->duration = DURATION;
test->server_affinity = -1;
test->title = NULL;
test->congestion = NULL;
test->state = 0;
test->server_hostname = NULL;
test->bind_address = NULL;

if(test->title) {
free(test->title);
test->title = NULL;
}
if(test->server_hostname) {
free(test->server_hostname);
test->server_hostname = NULL;
}
if(test->bind_address) {
free(test->bind_address);
test->bind_address = NULL;
}
if(test->congestion) {
free(test->congestion);
test->congestion = NULL;
}

test->ctrl_sck = -1;
test->prot_listener = -1;

Expand Down

0 comments on commit c7ddeba

Please sign in to comment.