!237 fsck: fix memory leak on an error exit

From: @cenhuilin 
Reviewed-by: @swf504 
Signed-off-by: @swf504
This commit is contained in:
openeuler-ci-bot 2024-07-05 02:41:00 +00:00 committed by Gitee
commit 75a2da0ba9
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1,29 @@
From 7b76a84fd8f75fb53849a751db27d7dfd17bd8b6 Mon Sep 17 00:00:00 2001
From: Theodore Ts'o <tytso@mit.edu>
Date: Tue, 2 Jul 2024 14:58:04 +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 <tytso@mit.edu>
---
misc/fsck.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/misc/fsck.c b/misc/fsck.c
index c56d1b0..fab0188 100644
--- a/misc/fsck.c
+++ b/misc/fsck.c
@@ -805,6 +805,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

View File

@ -1,6 +1,6 @@
Name: e2fsprogs
Version: 1.45.6
Release: 20
Release: 21
Summary: Second extended file system management tools
License: GPLv2 and LGPLv2 and GPLv2+
URL: http://e2fsprogs.sourceforge.net/
@ -62,6 +62,7 @@ Patch52: 0052-append_pathname-check-the-value-returned-by-realloc.patch
Patch53: 0053-argv_parse-check-return-value-of-malloc-in-argv_pars.patch
Patch54: 0054-libext2fs-improve-error-handling-in-POSIX-ACL-conver.patch
Patch55: 0055-libext2fs-batch-calls-to-ext2fs_zero_blocks2.patch
Patch56: 0056-fsck-fix-memory-leak-on-an-error-exit.patch
BuildRequires: gcc pkgconfig texinfo
BuildRequires: fuse-devel libblkid-devel libuuid-devel
@ -183,6 +184,9 @@ exit 0
%{_mandir}/man8/*
%changelog
* Tue Jul 2 2024 cenhuilin <cenhuilin@kylinos.cn> - 1.45.6-21
- fsck: fix memory leak on an error exit
* Tue Nov 28 2023 haowenchao <haowenchao2@huawei.com> - 1.45.6-20
- backport upstream to speed up mkfs.ext3