At Mon, 11 May 2015 20:25:41 +0800,
Bingpeng Zhu wrote:
> 
> In prepare_erasure_requests(), when init_erasure_buffer() returns NULL,
> we should release buffers of requests which are allocated via xmalloc().
> 
> Signed-off-by: Bingpeng Zhu <[email protected]>
> ---
>  sheep/gateway.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)

Applied, thanks.
Hitoshi

> 
> diff --git a/sheep/gateway.c b/sheep/gateway.c
> index 89db9bf..3cb21f0 100644
> --- a/sheep/gateway.c
> +++ b/sheep/gateway.c
> @@ -152,6 +152,8 @@ static struct req_iter *prepare_erasure_requests(struct 
> request *req, int *nr)
>       if (!buf) {
>               sd_err("failed to init erasure buffer %"PRIx64,
>                      req->rq.obj.oid);
> +             for (i = 0; i < nr_to_send; i++)
> +                     free(reqs[i].buf);
>               free(reqs);
>               reqs = NULL;
>               goto out;
> -- 
> 1.7.1
> 
> 
> 
> 
> -- 
> sheepdog mailing list
> [email protected]
> https://lists.wpkg.org/mailman/listinfo/sheepdog
-- 
sheepdog mailing list
[email protected]
https://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to