From: Greg Kurz Date: Tue, 12 Jun 2018 17:01:26 +0000 (+0200) Subject: spapr: fix leak in h_client_architecture_support() X-Git-Tag: v3.0.0-rc0~80^2~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c9dfdacc5a9f4db941c8f80597abae4658954ac;p=thirdparty%2Fqemu.git spapr: fix leak in h_client_architecture_support() If the negotiated compat mode can't be set, but raw mode is supported, we decide to ignore the error. An so, we should free it to prevent a memory leak. Signed-off-by: Greg Kurz Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: David Gibson --- diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index 022f6d81018..8b9a4b577fb 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -1547,6 +1547,7 @@ static target_ulong h_client_architecture_support(PowerPCCPU *cpu, error_report_err(local_err); return H_HARDWARE; } + error_free(local_err); local_err = NULL; } }