From: Jens Axboe Date: Fri, 7 Sep 2018 18:57:52 +0000 (-0600) Subject: log: remember to free output buffer when done X-Git-Tag: fio-3.10~11 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=d5bb0a8902b787718e7027be85573773781f0898;p=fio.git log: remember to free output buffer when done We need to ensure we call buf_output_free() after using the temp storage, otherwise we leaked the memory that we allocated while filling the buffer. Signed-off-by: Jens Axboe --- diff --git a/backend.c b/backend.c index 314d6e33..bb8bd13b 100644 --- a/backend.c +++ b/backend.c @@ -2228,6 +2228,7 @@ static void run_threads(struct sk_out *sk_out) } __log_buf(&out, "\n"); log_info_buf(out.buf, out.buflen); + buf_output_free(&out); } todo = thread_number; diff --git a/client.c b/client.c index 0f28cf63..b2fef2ad 100644 --- a/client.c +++ b/client.c @@ -1154,6 +1154,7 @@ static void handle_text(struct fio_client *client, struct fio_net_cmd *cmd) __log_buf(&out, "<%s> ", name); __log_buf(&out, "%s", buf); log_info_buf(out.buf, out.buflen); + buf_output_free(&out); client->skip_newline = strchr(buf, '\n') == NULL; } diff --git a/init.c b/init.c index b13cee26..c235b05e 100644 --- a/init.c +++ b/init.c @@ -1708,6 +1708,7 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, __log_buf(&out, "ioengine=%s, iodepth=%u\n", td->io_ops->name, o->iodepth); log_info_buf(out.buf, out.buflen); + buf_output_free(&out); free(c1); free(c2);