]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
spapr: Fix memory leak in h_client_architecture_support()
authorGreg Kurz <groug@kaod.org>
Sat, 21 Mar 2020 17:34:22 +0000 (18:34 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 24 Mar 2020 00:56:37 +0000 (11:56 +1100)
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>
hw/ppc/spapr_hcall.c

index 40c86e91eb890451b2f895a10906e6834938d487..0d50fc9117908c384aaf4862d188bee715eda8e3 100644 (file)
@@ -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;
     }