[PULL,5/7] spapr: Fix memory leak in h_client_architecture_support()
diff mbox series

Message ID 20200324051456.256116-6-david@gibson.dropbear.id.au
State New
Headers show
  • [PULL,1/7] ppc/spapr: Set the effective address provided flag in mc error log.
Related show

Commit Message

David Gibson March 24, 2020, 5:14 a.m. UTC
From: Greg Kurz <groug@kaod.org>

This is the only error path that needs to free the previously allocated

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 | 1 +
 1 file changed, 1 insertion(+)

diff mbox series

diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
index 40c86e91eb..0d50fc9117 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;