From: Pavel Reichl Date: Thu, 14 Dec 2023 21:10:25 +0000 (+0100) Subject: engines/http: Fix memory leak X-Git-Tag: fio-3.37~78^2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=9e66b0606cad74cb98dc44cb91903432171585a9;p=fio.git engines/http: Fix memory leak Found by Red Hat's OpenScanHub: fio-3.35/engines/http.c:253: leaked_storage: Variable r going out of scope leaks the storage it points to. Signed-off-by: Pavel Reichl --- diff --git a/engines/http.c b/engines/http.c index 56dc7d1b..83cfe8bb 100644 --- a/engines/http.c +++ b/engines/http.c @@ -250,6 +250,7 @@ static char *_aws_uriencode(const char *uri) for (i = 0; (c = uri[i]); i++) { if (n > bufsize-5) { log_err("encoding the URL failed\n"); + free(r); return NULL; }