!63 engines/http: Fix memory leak
From: @jamesblunt Reviewed-by: @wk333 Signed-off-by: @wk333
This commit is contained in:
commit
fc415e41a1
31
0002-engines-http-fix-memory-leak.patch
Normal file
31
0002-engines-http-fix-memory-leak.patch
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
From 9e66b0606cad74cb98dc44cb91903432171585a9 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pavel Reichl <preichl@redhat.com>
|
||||||
|
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 <preichl@redhat.com>
|
||||||
|
---
|
||||||
|
engines/http.c | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/engines/http.c b/engines/http.c
|
||||||
|
index 56dc7d1..83cfe8b 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
6
fio.spec
6
fio.spec
@ -1,6 +1,6 @@
|
|||||||
Name: fio
|
Name: fio
|
||||||
Version: 3.34
|
Version: 3.34
|
||||||
Release: 3
|
Release: 4
|
||||||
Summary: Multithreaded IO generation tool
|
Summary: Multithreaded IO generation tool
|
||||||
|
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
@ -9,6 +9,7 @@ Source0: http://brick.kernel.dk/snaps/%{name}-%{version}.tar.bz2
|
|||||||
|
|
||||||
#https://github.com/axboe/fio/pull/1736
|
#https://github.com/axboe/fio/pull/1736
|
||||||
Patch0001: 0001-fix-disk-stats-issue.patch
|
Patch0001: 0001-fix-disk-stats-issue.patch
|
||||||
|
Patch0002: 0002-engines-http-fix-memory-leak.patch
|
||||||
|
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
BuildRequires: libaio-devel
|
BuildRequires: libaio-devel
|
||||||
@ -82,6 +83,9 @@ make test
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Jun 5 2024 zhangyaqi <zhangyaqi@kylinos.cn> - 3.34-4
|
||||||
|
- engines/http: Fix memory leak
|
||||||
|
|
||||||
* Tue Apr 16 2024 cenhuilin <cenhuilin@kylinos.cn> - 3.34-3
|
* Tue Apr 16 2024 cenhuilin <cenhuilin@kylinos.cn> - 3.34-3
|
||||||
- iolog: fix disk stats issue
|
- iolog: fix disk stats issue
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user