]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_io: free fshandlep in parent_check()
authorEric Sandeen <sandeen@redhat.com>
Mon, 15 Sep 2014 23:18:21 +0000 (09:18 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 15 Sep 2014 23:18:21 +0000 (09:18 +1000)
The allocated fshandle wasn't freed in either normal
exit or error paths.

Do this, and consolidate cleanup into an out: target.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
io/parent.c

index ca989e9609560c8666e735004c3e65a0c6e23728..56e126d324b06669d8987f6605342d3c03bfb7bb 100644 (file)
@@ -258,9 +258,8 @@ parent_check(void)
        if (!bstatbuf || !parentbuf) {
                fprintf(stderr, _("unable to allocate buffers: %s\n"),
                        strerror(errno));
-               free(bstatbuf);
-               free(parentbuf);
-               return 1;
+               err_status = 1;
+               goto out;
        }
 
        if (do_bulkstat(parentbuf, &parentbuf_size, bstatbuf, fsfd, fshandlep) != 0)
@@ -272,8 +271,10 @@ parent_check(void)
                printf(_("succeeded checking %llu inodes\n"),
                        (unsigned long long) inodes_checked);
 
+out:
        free(bstatbuf);
        free(parentbuf);
+       free(fshandlep);
        return err_status;
 }