Skip to content

Commit

Permalink
Merge pull request #1712 from MattCatz/patch-2
Browse files Browse the repository at this point in the history
Fix memory leak for parallel tests
  • Loading branch information
bmah888 authored Oct 25, 2024
2 parents 38b4dde + 8a62bb7 commit 80e657f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/iperf_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -4319,6 +4319,7 @@ iperf_print_results(struct iperf_test *test)
}
if (test->server_output_text) {
iperf_printf(test, "\nServer output:\n%s\n", test->server_output_text);
free(test->server_output_text);
test->server_output_text = NULL;
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/iperf_client_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ iperf_create_streams(struct iperf_test *test, int sender)
i_errno = IESETCONGESTION;
return -1;
}
if (test->congestion_used) {
if (test->debug)
printf("Overriding existing congestion algorithm: %s\n", test->congestion_used);
free(test->congestion_used);
}
// Set actual used congestion alg, or set to unknown if could not get it
if (rc < 0)
test->congestion_used = strdup("unknown");
Expand Down

0 comments on commit 80e657f

Please sign in to comment.