From patchwork Thu Jul 4 16:00: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: 1127617 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) 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 45fjPq0Q6gz9sNf; Fri, 5 Jul 2019 02:01:02 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1hj4AN-0005BO-Dw; Thu, 04 Jul 2019 16:00:59 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1hj4AM-0005BD-Ez for fwts-devel@lists.ubuntu.com; Thu, 04 Jul 2019 16:00:58 +0000 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1hj4AM-00053X-3i; Thu, 04 Jul 2019 16:00:58 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH] lib: fwts_framework: fix memory leak on fw->fdt Date: Thu, 4 Jul 2019 17:00:57 +0100 Message-Id: <20190704160057.8350-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 Any data allocated for fw->fdt is not being free'd at the end of the framework, leading to a memory leak. Free it. Addresses-Coverity: ("Resource leak") Fixes: 3b364fca9699 ("devicetree: add infrastructure for device-tree tests") Signed-off-by: Colin Ian King Acked-by: Alex Hung Acked-by: Ivan Hu --- src/lib/src/fwts_framework.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/src/fwts_framework.c b/src/lib/src/fwts_framework.c index a84dc295..698fa49a 100644 --- a/src/lib/src/fwts_framework.c +++ b/src/lib/src/fwts_framework.c @@ -1633,6 +1633,7 @@ tidy_close: free(fw->olog); free(fw->json_data_path); free(fw->json_data_file); + free(fw->fdt); fwts_list_free_items(&fw->errors_filter_discard, NULL); fwts_list_free_items(&fw->errors_filter_keep, NULL);