[sheepdog] [PATCH v1 1/2] sheepfs: fix memory leak in object_create_entry()

Liu Yuan namei.unix at gmail.com
Thu Mar 6 08:15:50 CET 2014


On Thu, Mar 06, 2014 at 02:10:36PM +0800, Robin Dong wrote:
> From: Robin Dong <sanbai at taobao.com>
> 
> We should free all args after using split_path().
> 
> Signed-off-by: Robin Dong <sanbai at taobao.com>
> ---
>  sheepfs/http.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/sheepfs/http.c b/sheepfs/http.c
> index 2ff3cbe..50c0a82 100644
> --- a/sheepfs/http.c
> +++ b/sheepfs/http.c
> @@ -327,6 +327,8 @@ static int object_create_entry(const char *entry, const char *url)
>  	}
>  	ret = 0;
>  out:
> +	for (int i = 0; i < ARRAY_SIZE(args); i++)
> +		free(args[i]);
>  	strbuf_release(&buf);
>  	return ret;
>  }
> -- 
> 1.7.12.4
> 
> -- 
> sheepdog mailing list
> sheepdog at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/sheepdog

Applied these two, thanks

Yuan



More information about the sheepdog mailing list