qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] spapr: Fix memory leak in h_client_architecture_support()


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] spapr: Fix memory leak in h_client_architecture_support()
Date: Sat, 21 Mar 2020 19:06:51 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

On 3/21/20 6:34 PM, Greg Kurz wrote:
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 <address@hidden>
---
  hw/ppc/spapr_hcall.c |    1 +
  1 file changed, 1 insertion(+)

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

Quicker than using g_autoptr(), so for 5.0:

Reviewed-by: Philippe Mathieu-Daudé <address@hidden>

          warn_report("guest didn't provide option vector 5");
          return H_PARAMETER;
      }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]