[PATCH 6/6] xfs_db: free flist on error in write_struct()

Brian Foster bfoster at redhat.com
Tue Aug 5 08:31:53 CDT 2014


On Fri, Aug 01, 2014 at 09:59:19AM -0500, Eric Sandeen wrote:
> One error path in write_struct() wasn't freeing
> the flist_t *fl which was allocated, so it leaks.
> 
> Signed-off-by: Eric Sandeen <sandeen at redhat.com>
> ---

Reviewed-by: Brian Foster <bfoster at redhat.com>

>  db/write.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/db/write.c b/db/write.c
> index 0157a44..a0f14f4 100644
> --- a/db/write.c
> +++ b/db/write.c
> @@ -652,6 +652,7 @@ write_struct(
>  	buf = convert_arg(argv[1], bit_length);
>  	if (!buf) {
>  		dbprintf(_("unable to convert value '%s'.\n"), argv[1]);
> +		flist_free(fl);
>  		return;
>  	}
>  
> -- 
> 1.7.1
> 
> _______________________________________________
> xfs mailing list
> xfs at oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs



More information about the xfs mailing list