Re: [Qemu-block] [PATCH] qemu-io: Don't leak pattern file in error path

2019-09-10 Thread Stefano Garzarella
On Tue, Sep 10, 2019 at 09:09:49AM +0200, 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 >

Re: [Qemu-block] [PATCH] qemu-io: Don't leak pattern file in error path

2019-09-10 Thread Max Reitz
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

[Qemu-block] [PATCH] qemu-io: Don't leak pattern file in error path

2019-09-10 Thread Kevin Wolf
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.