[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH] xen-block: stop leaking memory in xen_block_dri
From: |
Anthony PERARD |
Subject: |
Re: [Qemu-block] [PATCH] xen-block: stop leaking memory in xen_block_drive_create() |
Date: |
Mon, 25 Feb 2019 16:46:31 +0000 |
User-agent: |
Mutt/1.11.3 (2019-02-01) |
On Tue, Feb 19, 2019 at 04:36:28PM +0000, Paul Durrant wrote:
> > The locally allocated QDict-s need to be freed. ('file_layer' will be
> > freed implicitly since it is added as an object to 'driver_layer').
> >
> > Spotted by Coverity: CID 1398649
> >
> > While in the neighbourhood free 'driver' and 'filename' as soon as they
> > are
> > added to the QDicts. Freeing after the 'done' label doesn't make that much
> > sense as, if the error path jumps to that label, the values would be NULL
> > anyway.
> >
> > This patch also makes that more obvious by taking the error path if
> > 'params' is NULL and then asserting that both driver and filename are
> > non-NULL in the normal path.
> >
> > Reported-by: Peter Maydell <address@hidden>
> > Signed-off-by: Paul Durrant <address@hidden>
Acked-by: Anthony PERARD <address@hidden>
Thanks,
--
Anthony PERARD