[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH] file-posix: Don't leak fd in hdev_get_max_segme
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-block] [PATCH] file-posix: Don't leak fd in hdev_get_max_segments |
Date: |
Tue, 14 Mar 2017 16:50:46 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 14.03.2017 um 16:43 hat Fam Zheng geschrieben:
> Signed-off-by: Fam Zheng <address@hidden>
> ---
> block/file-posix.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/block/file-posix.c b/block/file-posix.c
> index c4c0663..e6170f4 100644
> --- a/block/file-posix.c
> +++ b/block/file-posix.c
> @@ -703,6 +703,7 @@ static int hdev_get_max_segments(const struct stat *st)
> }
>
> out:
> + close(fd);
Should we make this conditional on fd != -1?
> g_free(sysfspath);
> return ret;
> #else
Kevin