btrfs-progs: close fd on cmd_subvol_list return
authorEric Sandeen <sandeen@redhat.com>
Mon, 4 Mar 2013 22:39:51 +0000 (16:39 -0600)
committerDavid Sterba <dsterba@suse.cz>
Sun, 10 Mar 2013 14:48:43 +0000 (15:48 +0100)
stops an fd leak that Coverity found.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
cmds-subvolume.c

index 461eed9..a13a58d 100644 (file)
@@ -464,6 +464,8 @@ static int cmd_subvol_list(int argc, char **argv)
                                !is_list_all && !is_only_in_path, NULL);
 
 out:
+       if (fd != -1)
+               close(fd);
        if (filter_set)
                btrfs_list_free_filter_set(filter_set);
        if (comparer_set)