hw/xen: Fix double-free in xen_console store_con_info()
commit69d4e746b3a899b90d2cbf422a3ce764cf51cfbe
authorDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 12 Apr 2023 18:51:01 +0000 (12 19:51 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 13 Apr 2023 09:09:31 +0000 (13 10:09 +0100)
tree2267c4b15cdb9de85ed00309b77e4d7805bbb343
parent9d177b7f87d96d1ed8fd16e222a37bd1ac8a0cd8
hw/xen: Fix double-free in xen_console store_con_info()

Coverity spotted a double-free (CID 1508254); we g_string_free(path) and
then for some reason immediately call free(path) too.

We should just use g_autoptr() for it anyway, which simplifies the code
a bit.

Fixes: 7a8a749da7d3 ("hw/xen: Move xenstore_store_pv_console_info to xen_console.c")
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/char/xen_console.c