From patchwork Wed Oct 30 09:26:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 1186610 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47334j6H1vz9sPq; Wed, 30 Oct 2019 20:27:01 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1iPkFn-00055C-0J; Wed, 30 Oct 2019 09:26:59 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iPkFm-000555-1F for fwts-devel@lists.ubuntu.com; Wed, 30 Oct 2019 09:26:58 +0000 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iPkFl-00051W-QX; Wed, 30 Oct 2019 09:26:57 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH] iASL: fix memory leak of LocalityBuffer on error return path Date: Wed, 30 Oct 2019 10:26:57 +0100 Message-Id: <20191030092657.1237-1-colin.king@canonical.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" From: Colin Ian King The error return path is not free'ing previously allocated resource LocalityBuffer and hence there is a memory leak. Fix this by free'ing it before returning. Fixes: c22c0b1df98c ("Data table compiler: Add error messages for SLIT locality buffers") Signed-off-by: Colin Ian King Acked-by: Alex Hung Acked-by: Ivan Hu --- src/acpica/source/compiler/dttable2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/acpica/source/compiler/dttable2.c b/src/acpica/source/compiler/dttable2.c index bbaaafaa..550cca13 100644 --- a/src/acpica/source/compiler/dttable2.c +++ b/src/acpica/source/compiler/dttable2.c @@ -1662,6 +1662,7 @@ DtCompileSlit ( "Found %u entries, must match LocalityCount: %u", LocalityListLength, Localities); DtError (ASL_ERROR, ASL_MSG_ENTRY_LIST, EndOfFieldList, AslGbl_MsgBuffer); + ACPI_FREE (LocalityBuffer); return (AE_LIMIT); }