From patchwork Mon Jun 18 03:53:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 930652 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.b="InfCFXdZ"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 418HKD6v7pz9s3T for ; Mon, 18 Jun 2018 13:54:24 +1000 (AEST) Received: from localhost ([::1]:60869 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUlFG-0005Ih-Fn for incoming@patchwork.ozlabs.org; Sun, 17 Jun 2018 23:54:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUlEU-0005IB-IV for qemu-devel@nongnu.org; Sun, 17 Jun 2018 23:53:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fUlET-0003wF-Qc for qemu-devel@nongnu.org; Sun, 17 Jun 2018 23:53:34 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:46875) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fUlET-0003tz-Dk; Sun, 17 Jun 2018 23:53:33 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 418HJ86DyRz9s47; Mon, 18 Jun 2018 13:53:28 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1529294008; bh=JESqcVnWpTJ7qAJnqUEinvmcmE/tP2CTnpZc6w/B3JQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=InfCFXdZgdo00iHOj22BqyobBzmpVevrBtS/Aek3BTwSUsykZafcR39mo5NSFqH1x jwnq2NQUJUhITZm73DA+ycHrx9EKZvL4cnHTT6EQvH1u8VO0+Pd4VRqZQPGOmFGwnx vbKEmSkbsX8wVDJqJm7KemxRyGSwmuiPcKj2VBZI= From: David Gibson To: peter.maydell@linaro.org Date: Mon, 18 Jun 2018 13:53:00 +1000 Message-Id: <20180618035324.19907-5-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180618035324.19907-1-david@gibson.dropbear.id.au> References: <20180618035324.19907-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 04/28] spapr: fix leak in h_client_architecture_support() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: aik@ozlabs.ru, agraf@suse.de, qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Greg Kurz 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 --- 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 022f6d8101..8b9a4b577f 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; } }