qemu/hw/block
Anthony PERARD aa36243514 xen-block: Avoid leaks on new error path
Commit 1898293990 ("xen-block: Use specific blockdev driver")
introduced a new error path, without taking care of allocated
resources.

So only allocate the qdicts after the error check, and free both
`filename` and `driver` when we are about to return and thus taking
care of both success and error path.

Coverity only spotted the leak of qdicts (*_layer variables).

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Fixes: Coverity CID 1508722, 1398649
Fixes: 1898293990 ("xen-block: Use specific blockdev driver")
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Paul Durrant <paul@xen.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20230704171819.42564-1-anthony.perard@citrix.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
2023-08-01 10:22:33 +01:00
..
dataplane virtio-blk: fix host notifier issues during dataplane start/stop 2023-07-12 15:20:32 -04:00
block.c
cdrom.c
ecc.c
fdc-internal.h
fdc-isa.c
fdc-sysbus.c
fdc.c
hd-geometry.c
Kconfig
m25p80.c
m25p80_sfdp.c
m25p80_sfdp.h
meson.build meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
nand.c
onenand.c
pflash_cfi01.c
pflash_cfi02.c
swim.c
tc58128.c
trace-events virtio-blk: add some trace events for zoned emulation 2023-05-15 08:18:10 -04:00
trace.h
vhost-user-blk.c vhost-user: fully use new backend/frontend naming 2023-06-26 09:50:00 -04:00
virtio-blk-common.c virtio-blk: add zoned storage emulation for zoned devices 2023-05-15 08:18:10 -04:00
virtio-blk.c block: add blk_io_plug_call() API 2023-06-01 07:34:03 -04:00
xen-block.c xen-block: Avoid leaks on new error path 2023-08-01 10:22:33 +01:00
xen_blkif.h