[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] xen-block: stop leaking memory in xen_block_drive_create()
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 <peter.maydell@xxxxxxxxxx> > > Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx> Acked-by: Anthony PERARD <anthony.perard@xxxxxxxxxx> Thanks, -- Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |