]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fincore: fix file descriptor leak
authorSami Kerola <kerolasa@iki.fi>
Thu, 6 Apr 2017 21:11:15 +0000 (22:11 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 10 Apr 2017 13:40:39 +0000 (15:40 +0200)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
misc-utils/fincore.c

index ffc02fc2c311bdbeaa1d01cacacc8cc89c96ae67..6a29f375a4c0cdddf6feae206379092d7c8f5bcd 100644 (file)
@@ -239,6 +239,7 @@ static int fincore_name(struct fincore_control *ctl,
 
        if (fstat (fd, sb) < 0) {
                warn(_("failed to do fstat: %s"), name);
+               close (fd);
                return -errno;
        }