From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stable-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id 90F52A045E
	for <public@inbox.dpdk.org>; Wed, 29 May 2019 14:43:24 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 609701B974;
	Wed, 29 May 2019 14:43:24 +0200 (CEST)
Received: from mga12.intel.com (mga12.intel.com [192.55.52.136])
 by dpdk.org (Postfix) with ESMTP id B7F781B974;
 Wed, 29 May 2019 14:43:22 +0200 (CEST)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
 by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 29 May 2019 05:43:20 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.60,527,1549958400"; d="scan'208";a="179566964"
Received: from silpixa00400214.ir.intel.com (HELO
 silpixa00400214.ger.corp.intel.com) ([10.237.222.119])
 by fmsmga002.fm.intel.com with ESMTP; 29 May 2019 05:43:20 -0700
From: Reshma Pattan <reshma.pattan@intel.com>
To: dev@dpdk.org
Cc: kevin.laatz@intel.com, Reshma Pattan <reshma.pattan@intel.com>,
 stable@dpdk.org, bruce.richardson@intel.com
Date: Wed, 29 May 2019 13:43:17 +0100
Message-Id: <20190529124317.30611-1-reshma.pattan@intel.com>
X-Mailer: git-send-email 2.21.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: [dpdk-stable] [PATCH] lib/telemetry: fix memory leak
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
Errors-To: stable-bounces@dpdk.org
Sender: "stable" <stable-bounces@dpdk.org>

Free the `values` pointer before returning
from rte_telemetry_command_ports_all_stat_values()
to avoid memory leak.

Fixes: c12cefa379 ("telemetry: fix mapping of statistics")
CC: stable@dpdk.org
CC: bruce.richardson@intel.com

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
---
 lib/librte_telemetry/rte_telemetry_parser.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_telemetry/rte_telemetry_parser.c b/lib/librte_telemetry/rte_telemetry_parser.c
index 9bc16eef4..e9297021a 100644
--- a/lib/librte_telemetry/rte_telemetry_parser.c
+++ b/lib/librte_telemetry/rte_telemetry_parser.c
@@ -342,6 +342,7 @@ rte_telemetry_command_ports_all_stat_values(struct telemetry_impl *telemetry,
 		goto fail;
 	}
 
+	free(values);
 	return 0;
 
 fail:
-- 
2.21.0