qemu-e2k/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 pflash: Fix blk_pread_nonzeroes() 2023-03-07 16:53:18 +01:00
cdrom.c
ecc.c
fdc-internal.h
fdc-isa.c hw: Replace isa_get_irq() by isa_bus_get_irq() when ISABus is available 2023-02-27 22:29:02 +01:00
fdc-sysbus.c
fdc.c hw/block: replace TABs with space 2023-03-24 11:45:46 +01:00
hd-geometry.c
Kconfig
m25p80_sfdp.c m25p80: Add the is25wp256 SFPD table 2023-02-07 09:02:04 +01:00
m25p80_sfdp.h m25p80: Add the is25wp256 SFPD table 2023-02-07 09:02:04 +01:00
m25p80.c m25p80: Improve error when the backend file size does not match the device 2023-03-07 16:53:18 +01:00
meson.build meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
nand.c hw/block: replace TABs with space 2023-03-24 11:45:46 +01:00
onenand.c hw/block: replace TABs with space 2023-03-24 11:45:46 +01:00
pflash_cfi01.c Drop duplicate #include 2023-02-08 07:28:05 +01:00
pflash_cfi02.c Revert "hw/block/pflash_cfi: Error out if dev length isn't power of 2" 2022-11-08 15:53:40 -05:00
swim.c
tc58128.c hw/block: replace TABs with space 2023-03-24 11:45:46 +01:00
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_blkif.h
xen-block.c xen-block: Avoid leaks on new error path 2023-08-01 10:22:33 +01:00