Fix memory leak in an error condition.

We weren't free()-ing test->settings when we bailed out in a
certain error state.

Fixes #1332.
This commit is contained in:
Bruce A. Mah 2022-05-09 17:43:38 -07:00
parent 3a8e21f33a
commit abb24a2efc
No known key found for this signature in database
GPG Key ID: 4984910A8CAAEE8A

View File

@ -2703,6 +2703,7 @@ iperf_new_test()
test->bitrate_limit_intervals_traffic_bytes = (iperf_size_t *) malloc(sizeof(iperf_size_t) * MAX_INTERVAL);
if (!test->bitrate_limit_intervals_traffic_bytes) {
free(test->settings);
free(test);
i_errno = IENEWTEST;
return NULL;