Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/martin-ottens/iperf into …
Browse files Browse the repository at this point in the history
…martin-ottens-master
  • Loading branch information
swlars committed Jan 17, 2025
2 parents 352ef1b + 01888d2 commit e8964c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/iperf_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ iperf_errexit(struct iperf_test *test, const char *format, ...)
}
iperf_json_finish(test);
} else {
if (pthread_mutex_lock(&(test->print_mutex)) != 0) {
if (test != NULL && pthread_mutex_lock(&(test->print_mutex)) != 0) {
perror("iperf_errexit: pthread_mutex_lock");
}

Expand All @@ -128,7 +128,7 @@ iperf_errexit(struct iperf_test *test, const char *format, ...)
fprintf(stderr, "iperf3: %s\n", str);
}

if (pthread_mutex_unlock(&(test->print_mutex)) != 0) {
if (test != NULL && pthread_mutex_unlock(&(test->print_mutex)) != 0) {
perror("iperf_errexit: pthread_mutex_unlock");
}
}
Expand Down

0 comments on commit e8964c3

Please sign in to comment.