Whamcloud - gitweb
fsck: fix memory leak on an error exit
authorTheodore Ts'o <tytso@mit.edu>
Thu, 25 Apr 2024 17:22:15 +0000 (13:22 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 25 Apr 2024 17:22:15 +0000 (13:22 -0400)
This reduces noise from a static analyzer.

https://github.com/tytso/e2fsprogs/issues/160

Signed-off-by: Theodore Ts'o <tytso@mit.
misc/fsck.c

index 1769a10..64d0e7c 100644 (file)
@@ -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);
                        }
                }