spapr_pci: fix leak in spapr_phb_vfio_get_loc_code
commitc4ef328bdc5dac319c8a1bdbe6d4108382b41584
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 5 Sep 2022 10:17:45 +0000 (5 12:17 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Sun, 18 Sep 2022 07:17:40 +0000 (18 09:17 +0200)
tree77e0cd4f717aac6eeec3bd6f87dbce1d4a4c4f2b
parent21adec30f62e4e700e0e217da756723e189d7b29
spapr_pci: fix leak in spapr_phb_vfio_get_loc_code

Overwriting "path" in the second call to g_strdup_printf() causes a memory leak,
even if the variable itself is g_autofree.

Reported by Coverity as CID 1460454.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/ppc/spapr_pci.c