xfs
[Top] [All Lists]

Re: [PATCH 3/6] xfs_fsr: free handlep in fsrfs

To: Eric Sandeen <sandeen@xxxxxxxxxx>
Subject: Re: [PATCH 3/6] xfs_fsr: free handlep in fsrfs
From: Brian Foster <bfoster@xxxxxxxxxx>
Date: Tue, 5 Aug 2014 09:16:28 -0400
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1406905159-12415-4-git-send-email-sandeen@xxxxxxxxxx>
References: <1406905159-12415-1-git-send-email-sandeen@xxxxxxxxxx> <1406905159-12415-4-git-send-email-sandeen@xxxxxxxxxx>
User-agent: Mutt/1.5.23 (2014-03-12)
On Fri, Aug 01, 2014 at 09:59:16AM -0500, Eric Sandeen wrote:
> We leaked the fshandlep in both error returns and
> normal function exit.
> 
> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
> ---

Same thing in the 'if (endtime && endtime < time(0))' thing towards the
end of the for loop, but that ends with an exit(), so:

Reviewed-by: Brian Foster <bfoster@xxxxxxxxxx>

>  fsr/xfs_fsr.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
> index 752d2db..580604c 100644
> --- a/fsr/xfs_fsr.c
> +++ b/fsr/xfs_fsr.c
> @@ -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;
>  }
>  
> -- 
> 1.7.1
> 
> _______________________________________________
> xfs mailing list
> xfs@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs

<Prev in Thread] Current Thread [Next in Thread>