From 0b15c449892db70990270d7606d3d8a9116213ab Mon Sep 17 00:00:00 2001 From: Sarah Larsen Date: Wed, 22 Sep 2021 18:54:39 -0700 Subject: [PATCH] Add comment to clean_up_and_fail --- src/iperf_client_api.c | 2 ++ 1 file changed, 2 insertions(+) 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);