From 3bb3582a128c6f90f8a368118f8271ea93ad4d42 Mon Sep 17 00:00:00 2001 From: Bonobo Date: Fri, 14 Aug 2026 02:27:41 +0200 Subject: [PATCH] fix(json): release rendered output on test reset Persistent servers reuse one iperf_test across runs. Free the test-owned rendered JSON string during reset so the next full JSON result cannot orphan the previous allocation. --- src/iperf_api.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/iperf_api.c b/src/iperf_api.c index ebf76783f..153083ad6 100644 --- a/src/iperf_api.c +++ b/src/iperf_api.c @@ -3826,6 +3826,10 @@ iperf_reset_test(struct iperf_test *test) free(test->extra_data); test->extra_data = NULL; } + if (test->json_output_string) { + free(test->json_output_string); + test->json_output_string = NULL; + } /* Free output line buffers, if any (on the server only) */ struct iperf_textline *t;