From: Greg Kurz Date: Sat, 21 Mar 2020 17:34:22 +0000 (+0100) Subject: spapr: Fix memory leak in h_client_architecture_support() X-Git-Tag: v5.0.0-rc0~3^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ce05fa0fcc9e23d16b2ff079cb3cb6aceaccbc28;p=thirdparty%2Fqemu.git 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 Message-Id: <158481206205.336182.16106097429336044843.stgit@bahia.lan> Signed-off-by: David Gibson Reviewed-by: Philippe Mathieu-Daudé --- diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index 40c86e91eb8..0d50fc91179 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; }