diff --git a/0002-engines-http-Fix-memory-leak.patch b/0002-engines-http-Fix-memory-leak.patch new file mode 100644 index 0000000000000000000000000000000000000000..fc7bdfa6284c0982a4580689deac7873f8be5b81 --- /dev/null +++ b/0002-engines-http-Fix-memory-leak.patch @@ -0,0 +1,31 @@ +From 9e66b0606cad74cb98dc44cb91903432171585a9 Mon Sep 17 00:00:00 2001 +From: Pavel Reichl +Date: Thu, 14 Dec 2023 22:10:25 +0100 +Subject: engines/http: Fix memory leak + +Reference:https://git.kernel.org/pub/scm/linux/kernel/git/axboe/fio.git/patch/?id=9e66b0606cad74cb98dc44cb91903432171585a9 + +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 +--- + engines/http.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/engines/http.c b/engines/http.c +index 35c4487..b6a5f29 100644 +--- a/engines/http.c ++++ b/engines/http.c +@@ -213,6 +213,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; + } + +-- +2.27.0 + diff --git a/fio.spec b/fio.spec index 084bff4c50ad2f3add86eb587330603bfaac30c7..5df65ee3366fb4324e07cacf7142a76506638d57 100644 --- a/fio.spec +++ b/fio.spec @@ -1,6 +1,6 @@ Name: fio Version: 3.29 -Release: 4 +Release: 5 Summary: Versatile IO workload generator License: GPLv2 URL: http://git.kernel.dk/?p=fio.git;a=summary @@ -8,6 +8,7 @@ Source: http://brick.kernel.dk/snaps/%{name}-%{version}.tar.bz2 Patch0: Fix-build-warning-on-loongarch64.patch #https://github.com/axboe/fio/pull/1736 Patch1: 0001-fix-disk-stats-issue.patch +Patch2: 0002-engines-http-Fix-memory-leak.patch BuildRequires: libaio-devel python3-devel zlib-devel numactl-devel librdmacm-devel gcc @@ -54,6 +55,9 @@ export EXTFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" %{_mandir}/man1/* %changelog +* Wed Jun 5 2024 zhangyaqi - 3.29-5 +- engines/http: Fix memory leak + * Mon May 27 2024 cenhuilin - 3.29-4 - iolog: fix disk stats issue