qemu-patch-raspberry4/target
Peter Maydell 523a3d9524 target/i386: Fix memory leak in sev_read_file_base64()
In sev_read_file_base64() we call g_file_get_contents(), which
allocates memory for the file contents.  We then base64-decode the
contents (which allocates another buffer for the decoded data), but
forgot to free the memory for the original file data.

Use g_autofree to ensure that the file data is freed.

Fixes: Coverity CID 1459997
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210820165650.2839-1-peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-09-30 15:30:24 +02:00
..
alpha hw/core: Make do_unaligned_access noreturn 2021-09-21 19:36:44 -07:00
arm hw/core: Make do_unaligned_access noreturn 2021-09-21 19:36:44 -07:00
avr include/exec: Move cpu_signal_handler declaration 2021-09-21 19:36:44 -07:00
cris include/exec: Move cpu_signal_handler declaration 2021-09-21 19:36:44 -07:00
hexagon include/exec: Move cpu_signal_handler declaration 2021-09-21 19:36:44 -07:00
hppa hw/core: Make do_unaligned_access noreturn 2021-09-21 19:36:44 -07:00
i386 target/i386: Fix memory leak in sev_read_file_base64() 2021-09-30 15:30:24 +02:00
m68k include/exec: Move cpu_signal_handler declaration 2021-09-21 19:36:44 -07:00
microblaze hw/core: Make do_unaligned_access noreturn 2021-09-21 19:36:44 -07:00
mips hw/core: Make do_unaligned_access noreturn 2021-09-21 19:36:44 -07:00
nios2 hw/core: Make do_unaligned_access noreturn 2021-09-21 19:36:44 -07:00
openrisc include/exec: Move cpu_signal_handler declaration 2021-09-21 19:36:44 -07:00
ppc hw/core: Make do_unaligned_access noreturn 2021-09-21 19:36:44 -07:00
riscv hw/core: Make do_unaligned_access noreturn 2021-09-21 19:36:44 -07:00
rx include/exec: Move cpu_signal_handler declaration 2021-09-21 19:36:44 -07:00
s390x hw/core: Make do_unaligned_access noreturn 2021-09-21 19:36:44 -07:00
sh4 hw/core: Make do_unaligned_access noreturn 2021-09-21 19:36:44 -07:00
sparc include/exec: Move cpu_signal_handler declaration 2021-09-21 19:36:44 -07:00
tricore include/exec: Move cpu_signal_handler declaration 2021-09-21 19:36:44 -07:00
xtensa hw/core: Make do_unaligned_access noreturn 2021-09-21 19:36:44 -07:00
Kconfig meson: Introduce target-specific Kconfig 2021-07-09 18:21:34 +02:00
meson.build Drop the deprecated unicore32 target 2021-05-12 18:20:52 +02:00