[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH] qemu-io: Don't leak pattern file in error path
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH] qemu-io: Don't leak pattern file in error path |
Date: |
Tue, 10 Sep 2019 09:45:00 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 10.09.19 09:09, Kevin Wolf wrote:
> qemu_io_alloc_from_file() needs to close the pattern file even if some
> error occurred.
>
> Setting f = NULL in the success path and checking it for NULL in the
> error path isn't strictly necessary at this point, but let's do it
> anyway in case someone later adds a 'goto error' after closing the file.
>
> Coverity: CID 1405303
> Fixes: 4d731510d34f280ed45a6de621d016f67a49ea48
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> qemu-io-cmds.c | 4 ++++
> 1 file changed, 4 insertions(+)
Reviewed-by: Max Reitz <address@hidden>
signature.asc
Description: OpenPGP digital signature