diff --git a/src/iperf_client_api.c b/src/iperf_client_api.c index a602bdd..f1dfeb1 100644 --- a/src/iperf_client_api.c +++ b/src/iperf_client_api.c @@ -656,6 +656,8 @@ iperf_run_client(struct iperf_test * test) cJSON_AddStringToObject(test->json_top, "error", iperf_strerror(i_errno)); iperf_json_finish(test); iflush(test); + // Return 0 and not -1 since all terminating function were done here. + // Also prevents error message logging outside the already closed JSON output. return 0; } iflush(test);