]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_fsr: free handlep in fsrfs
authorEric Sandeen <sandeen@redhat.com>
Mon, 15 Sep 2014 23:18:56 +0000 (09:18 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 15 Sep 2014 23:18:56 +0000 (09:18 +1000)
We leaked the fshandlep in both error returns and normal function
exit.

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

index 752d2dbddb3bda6eccb0fd82b82a7a7482b57ad4..580604cbad75cab8c311ea9f847355fccc85004f 100644 (file)
@@ -702,6 +702,7 @@ fsrfs(char *mntdir, xfs_ino_t startino, int targetrange)
        if ((fsfd = open(mntdir, O_RDONLY)) < 0) {
                fsrprintf(_("unable to open: %s: %s\n"),
                          mntdir, strerror( errno ));
+               free(fshandlep);
                return -1;
        }
 
@@ -709,6 +710,7 @@ fsrfs(char *mntdir, xfs_ino_t startino, int targetrange)
                fsrprintf(_("Skipping %s: could not get XFS geometry\n"),
                          mntdir);
                close(fsfd);
+               free(fshandlep);
                return -1;
        }
 
@@ -774,6 +776,7 @@ fsrfs(char *mntdir, xfs_ino_t startino, int targetrange)
 out0:
        tmp_close(mntdir);
        close(fsfd);
+       free(fshandlep);
        return 0;
 }