From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7A796A034F; Tue, 12 May 2020 17:31:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5D7A11C00D; Tue, 12 May 2020 17:31:07 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id C394A1BFB3 for ; Tue, 12 May 2020 17:31:03 +0200 (CEST) IronPort-SDR: ingr+almvBHhGwWvlg3A3y7cOJsWsFFdb1H/7l6TD24bdt8cs88hj3vegTgSj1dV0clAbGV2f6 L9oPzz0QUMWA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2020 08:31:03 -0700 IronPort-SDR: LYfrlGfr6/us69LwfgFvFovrH0H7eGkcRRFLNFOmVQAY+ugFHVV184DOA+fYlBQC+T9dwBN0s0 wj7+rwIfuCEw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,384,1583222400"; d="scan'208";a="409336949" Received: from silpixa00399953.ir.intel.com (HELO silpixa00399953.ger.corp.intel.com) ([10.237.222.53]) by orsmga004.jf.intel.com with ESMTP; 12 May 2020 08:31:02 -0700 From: Ciara Power To: bruce.richardson@intel.com Cc: dev@dpdk.org, Ciara Power Date: Tue, 12 May 2020 16:29:00 +0100 Message-Id: <20200512152902.70211-4-ciara.power@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200512152902.70211-1-ciara.power@intel.com> References: <20200512152902.70211-1-ciara.power@intel.com> Subject: [dpdk-dev] [PATCH 3/5] telemetry: fix closing socket fd on error 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" The socket fd is now being closed when the connection fails. Coverity issue: 358444 Fixes: b80fe1805eee ("telemetry: introduce backward compatibility") Cc: ciara.power@intel.com Signed-off-by: Ciara Power --- lib/librte_telemetry/telemetry_legacy.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_telemetry/telemetry_legacy.c b/lib/librte_telemetry/telemetry_legacy.c index 10b575adfd..72471cbfbe 100644 --- a/lib/librte_telemetry/telemetry_legacy.c +++ b/lib/librte_telemetry/telemetry_legacy.c @@ -100,6 +100,7 @@ register_client(const char *cmd __rte_unused, const char *params, if (connect(fd, (struct sockaddr *)&addrs, sizeof(addrs)) == -1) { perror("\nClient connection error\n"); + close(fd); return -1; } pthread_create(&th, NULL, &legacy_client_handler, -- 2.17.1