Files
qemu/util
Stefan Berger cc40b8b844 util/error: Fix use-after-free errors reported by Coverity
Fix use-after-free errors in the code path that called error_handle(). A
call to error_handle() will now either free the passed Error 'err' or
assign it to '*errp' if '*errp' is currently NULL. This ensures that 'err'
either has been freed or is assigned to '*errp' if this function returns.
Adjust the two callers of this function to not assign the 'err' to '*errp'
themselves, since this is now handled by error_handle().

Fixes: commit 3ffef1a55c ("error: add global &error_warn destination")
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20230406154347.4100700-1-stefanb@linux.ibm.com
2023-04-06 12:38:42 -04:00
..
2023-03-20 12:43:50 +01:00
2023-03-20 12:43:50 +01:00
2022-12-20 17:09:41 -08:00
2022-04-21 17:03:51 +04:00
2023-03-08 00:37:48 +01:00
2020-12-10 17:16:44 +01:00
2023-03-13 15:23:37 +04:00
2022-06-29 10:56:12 +03:00
2023-02-02 11:48:20 +00:00
2022-03-04 18:14:40 +01:00
2021-04-01 15:27:44 +04:00