aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Kurz <groug@kaod.org>2020-03-21 18:34:22 +0100
committerDavid Gibson <david@gibson.dropbear.id.au>2020-03-24 11:56:37 +1100
commitce05fa0fcc9e23d16b2ff079cb3cb6aceaccbc28 (patch)
treeabf20b88db69450249fe17a32a50709b360531e3
parentfeb39b62288cb780561ca83b84ca82dceb3cedb9 (diff)
downloadqemu-ce05fa0fcc9e23d16b2ff079cb3cb6aceaccbc28.zip
qemu-ce05fa0fcc9e23d16b2ff079cb3cb6aceaccbc28.tar.gz
qemu-ce05fa0fcc9e23d16b2ff079cb3cb6aceaccbc28.tar.bz2
spapr: Fix memory leak in h_client_architecture_support()
This is the only error path that needs to free the previously allocated ov1. Reported-by: Coverity (CID 1421924) Fixes: cbd0d7f36322 "spapr: Fail CAS if option vector table cannot be parsed" Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <158481206205.336182.16106097429336044843.stgit@bahia.lan> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
-rw-r--r--hw/ppc/spapr_hcall.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
index 40c86e9..0d50fc9 100644
--- a/hw/ppc/spapr_hcall.c
+++ b/hw/ppc/spapr_hcall.c
@@ -1726,6 +1726,7 @@ static target_ulong h_client_architecture_support(PowerPCCPU *cpu,
}
ov5_guest = spapr_ovec_parse_vector(ov_table, 5);
if (!ov5_guest) {
+ spapr_ovec_cleanup(ov1_guest);
warn_report("guest didn't provide option vector 5");
return H_PARAMETER;
}