From patchwork Wed Jul 29 08:37:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sexton, Rory" X-Patchwork-Id: 74985 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0F70EA052B; Wed, 29 Jul 2020 10:37:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CCE861BFF5; Wed, 29 Jul 2020 10:37:58 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 0A60F4C93 for ; Wed, 29 Jul 2020 10:37:56 +0200 (CEST) IronPort-SDR: NvRins1LmiEoxtOCVotE07j4Xw6v+LHRORS8+F+IwOBSR/X2JayoSurWLg4Mo3OSEegbER9zi4 TrvvdDENwwug== X-IronPort-AV: E=McAfee;i="6000,8403,9696"; a="151359553" X-IronPort-AV: E=Sophos;i="5.75,409,1589266800"; d="scan'208";a="151359553" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jul 2020 01:37:55 -0700 IronPort-SDR: S3459eJEQ22Pt3sas8LawJxckBSsbKCs9z39EcFe0PP7fFpIjmiZ5YkQuqjR9XZhg1gFqHibDx 0kKsHlbDqR2g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,409,1589266800"; d="scan'208";a="490685887" Received: from silpixa00399913.ir.intel.com ([10.237.213.189]) by fmsmga005.fm.intel.com with ESMTP; 29 Jul 2020 01:37:54 -0700 From: Rory Sexton To: dev@dpdk.org, david.hunt@intel.com Cc: marko.kovacevic@intel.com Date: Wed, 29 Jul 2020 09:37:54 +0100 Message-Id: <20200729083754.1044630-1-rory.sexton@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 1/1] examples/vm_power_manager: fix resource leak X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fix memory leak where variable oob_enable can go out of scope leaking the storage it points to. Coverity issue: 337674 Fixes: 95f648ff9ee ("examples/vm_power: make branch ratio threshold per core") Signed-off-by: Rory Sexton Acked-by: David Hunt Acked-by: David Hunt --- examples/vm_power_manager/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c index 77797b1e1..0242cca1a 100644 --- a/examples/vm_power_manager/main.c +++ b/examples/vm_power_manager/main.c @@ -209,6 +209,7 @@ parse_args(int argc, char **argv) } if (branch_ratio <= 0.0 || branch_ratio > 100.0) { printf("invalid branch ratio specified\n"); + free(oob_enable); return -1; } for (i = 0; i < ci->core_count; i++) {