From ebae36a28aeedcb39ae86fde020502cfbb9dc65b Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 17 Jan 2020 21:10:41 -0800 Subject: [PATCH] client: Fix memory leaks in handle_job_opt() This patch fixes the following Coverity complaint: CID 169311 (#1 of 1): Resource leak (RESOURCE_LEAK) 9. leaked_storage: Variable p going out of scope leaks the storage it points to. Signed-off-by: Bart Van Assche --- client.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client.c b/client.c index 55d89a0e..93bca5df 100644 --- a/client.c +++ b/client.c @@ -1157,6 +1157,10 @@ static void handle_job_opt(struct fio_client *client, struct fio_net_cmd *cmd) struct flist_head *opt_list = &client->opt_lists[pdu->groupid]; flist_add_tail(&p->list, opt_list); + } else { + free(p->value); + free(p->name); + free(p); } } -- 2.25.1