From 89ceeccb765504d6d3dd17f459d792fe429380ab Mon Sep 17 00:00:00 2001 From: cenhuilin Date: Tue, 2 Jul 2024 11:31:46 +0800 Subject: [PATCH] fsck: fix memory leak on an error exit (cherry picked from commit e308b3ebb368db37733653199feb8488a669a1c0) --- ...sck-fix-memory-leak-on-an-error-exit.patch | 29 +++++++++++++++++++ e2fsprogs.spec | 6 +++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 0016-fsck-fix-memory-leak-on-an-error-exit.patch diff --git a/0016-fsck-fix-memory-leak-on-an-error-exit.patch b/0016-fsck-fix-memory-leak-on-an-error-exit.patch new file mode 100644 index 0000000..ac7a890 --- /dev/null +++ b/0016-fsck-fix-memory-leak-on-an-error-exit.patch @@ -0,0 +1,29 @@ +From 7b76a84fd8f75fb53849a751db27d7dfd17bd8b6 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Tue, 2 Jul 2024 11:23:47 +0800 +Subject: [PATCH] fsck: fix memory leak on an error exit + +This reduces noise from a static analyzer. + +https://github.com/tytso/e2fsprogs/issues/160 + +Signed-off-by: Theodore Ts'o +--- + misc/fsck.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/misc/fsck.c b/misc/fsck.c +index 1769a10..64d0e7c 100644 +--- a/misc/fsck.c ++++ b/misc/fsck.c +@@ -806,6 +806,7 @@ static void compile_fs_type(char *fs_type, struct fs_type_compile *cmp) + if ((negate && !cmp->negate) || + (!negate && cmp->negate)) { + fputs(_(fs_type_syntax_error), stderr); ++ free(list); + exit(EXIT_USAGE); + } + } +-- +2.33.0 + diff --git a/e2fsprogs.spec b/e2fsprogs.spec index 3763542..b69bc52 100644 --- a/e2fsprogs.spec +++ b/e2fsprogs.spec @@ -1,6 +1,6 @@ Name: e2fsprogs Version: 1.47.0 -Release: 6 +Release: 7 Summary: Second extended file system management tools License: GPLv2+ and LGPLv2 and MIT URL: http://e2fsprogs.sourceforge.net/ @@ -22,6 +22,7 @@ Patch12: 0012-debugfs-fix-infinite-loop-while-dumping-the-journal.patch Patch13: 0013-e4crypt-fix-spurious-Success-error-message.patch Patch14: 0014-e2fsck-update-quota-accounting-after-directory-optim.patch Patch15: 0015-e2fsck-update-quota-when-deallocating-a-bad-inode.patch +Patch16: 0016-fsck-fix-memory-leak-on-an-error-exit.patch BuildRequires: gcc pkgconfig texinfo BuildRequires: fuse-devel libblkid-devel libuuid-devel @@ -162,6 +163,9 @@ exit 0 %{_mandir}/man8/* %changelog +* Tue Jul 2 2024 cenhuilin - 1.47.0-7 +- fsck: fix memory leak on an error exit + * Fri Jun 21 2024 liuh - 1.47.0-6 - sync patch from community e2fsck: update quota when deallocating a bad inode -- Gitee