[sheepdog] [PATCH v2] fix memory leak and wrong lock release in create_work_queue() function

Hitoshi Mitake mitake.hitoshi at gmail.com
Tue Jun 25 03:33:23 CEST 2013


At Sat, 15 Jun 2013 22:13:33 +0800,
justlinux2010 wrote:
> 
> [1  <multipart/alternative (7bit)>]
> [1.1  <text/plain; utf-8 (base64)>]
> diff --git a/sheepdog/lib/work.c b/sheepdog_develop/lib/work.c
> index b09c0db..abfee61 100644
> --- a/sheepdog/lib/work.c
> +++ b/sheepdog_develop/lib/work.c
> @@ -318,11 +318,11 @@ struct work_queue *create_work_queue(const char *name,
>  
>         return &wi->q;
>  destroy_threads:
> -       pthread_mutex_unlock(&wi->startup_lock);
>         pthread_cond_destroy(&wi->pending_cond);
>         pthread_mutex_destroy(&wi->pending_lock);
>         pthread_mutex_destroy(&wi->startup_lock);
>         pthread_mutex_destroy(&wi->finished_lock);
> +    free(wi);
>  
>         return NULL;
>  }
> 

The modification this patch makes seems to be correct, thanks. But the
form of this patch is invalid. You shouldn't use html mail and have to
add your Signed-off-by.

Could you send version 2 according to this guideline?:
https://github.com/collie/sheepdog/wiki/Submit-a-patch

Thanks,
Hitoshi



More information about the sheepdog mailing list