From: Bart Van Assche Date: Sat, 30 May 2020 21:58:34 +0000 (-0700) Subject: client: Fix a memory leak in an error path X-Git-Tag: fio-3.21~35^2~1 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=bfb81533885f0c2e23f8c1ba5cc1e85de49efa8e;p=fio.git client: Fix a memory leak in an error path This patch fixes the following Coverity complaint: CID 300985 (#1 of 1): Resource leak (RESOURCE_LEAK) leaked_storage: Variable client going out of scope leaks the storage it points to. Signed-off-by: Bart Van Assche --- diff --git a/client.c b/client.c index b7575596..7e5ac17d 100644 --- a/client.c +++ b/client.c @@ -471,8 +471,10 @@ int fio_client_add(struct client_ops *ops, const char *hostname, void **cookie) &client->is_sock, &client->port, &client->addr.sin_addr, &client->addr6.sin6_addr, - &client->ipv6)) + &client->ipv6)) { + fio_put_client(client); return -1; + } client->fd = -1; client->ops = ops;