]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
more: fix double free crash
authorSami Kerola <kerolasa@iki.fi>
Fri, 21 Feb 2014 10:17:11 +0000 (10:17 +0000)
committerKarel Zak <kzak@redhat.com>
Fri, 21 Feb 2014 12:45:32 +0000 (13:45 +0100)
Commit b9579f1f44b46c9f12f1e01b01c02d82ae1cf728 moved fclose() to
checkf(), but missed removing file closure in magic().  Ironically the
cause of regression is in previous commit message.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
text-utils/more.c

index b06abbb63f77a3aab36d543ac88b1757c7e6147b..d05e9467cb36a4a6b769f0cf44656d3bf5700324 100644 (file)
@@ -639,7 +639,6 @@ static int magic(FILE *f, char *fs)
                case 0x457f:    /* simple ELF detection */
                        printf(_("\n******** %s: Not a text file ********\n\n"),
                               fs);
-                       fclose(f);
                        return 1;
                }
        }