]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fsck: don't free fstab table on parse failure
authorDave Reisner <d@falconindy.com>
Tue, 27 Mar 2012 12:53:58 +0000 (08:53 -0400)
committerKarel Zak <kzak@redhat.com>
Tue, 10 Apr 2012 09:44:47 +0000 (11:44 +0200)
Even if we fail parsing, fstab gets referenced later in the code (and
will subsequently crash via heap corruption). Take the easy way out and
simply avoid deallocating this table, as it will be freed for us on
program exit regardless.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
disk-utils/fsck.c

index a019a6979bdee048f511448c80b158af352e7f62..44200d08fa8f289bf8d0ced0748e5a58b2d45028 100644 (file)
@@ -430,7 +430,6 @@ static void load_fs_info(void)
        path = getenv("FSTAB_FILE");
 
        if (mnt_table_parse_fstab(fstab, path)) {
-               mnt_free_table(fstab);
                if (!path)
                        path = mnt_get_fstab_path();
                if (errno)