[Sheepdog] [PATCH] fixed a fd leak in read_working_object()
Liu Yuan
namei.unix at gmail.com
Fri Apr 6 12:14:22 CEST 2012
On 04/05/2012 02:43 PM, Li Wenpeng wrote:
> From: levin li <xingke.lwp at taobao.com>
>
> Signed-off-by: levin li <xingke.lwp at taobao.com>
> ---
> sheep/farm/farm.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/sheep/farm/farm.c b/sheep/farm/farm.c
> index 37faf7a..eaf361c 100644
> --- a/sheep/farm/farm.c
> +++ b/sheep/farm/farm.c
> @@ -314,9 +314,10 @@ static void *read_working_object(uint64_t oid, int length)
> buf = NULL;
> goto out;
> }
> - close(fd);
>
> out:
> + if (fd > 0)
> + close(fd);
> return buf;
> }
>
Applied, thanks.
Yuan
More information about the sheepdog
mailing list