From patchwork Mon Jul 4 16:17:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Pattan, Reshma" X-Patchwork-Id: 14543 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 93DA929C6; Mon, 4 Jul 2016 18:17:36 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 0CE0E9E7 for ; Mon, 4 Jul 2016 18:17:34 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP; 04 Jul 2016 09:17:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.26,575,1459839600"; d="scan'208"; a="1015497205" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 04 Jul 2016 09:17:33 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id u64GHWP1029652; Mon, 4 Jul 2016 17:17:32 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id u64GHW8e022315; Mon, 4 Jul 2016 17:17:32 +0100 Received: (from reshmapa@localhost) by sivswdev02.ir.intel.com with id u64GHVKj022311; Mon, 4 Jul 2016 17:17:31 +0100 From: Reshma Pattan To: dev@dpdk.org Cc: Reshma Pattan Date: Mon, 4 Jul 2016 17:17:29 +0100 Message-Id: <1467649049-22275-1-git-send-email-reshma.pattan@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] pdump: close client socket X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Close the client socket before returning on error. Coverity issue: 127555 Fixes: f3c1829130ac ("pdump: check missing home environment variable") Signed-off-by: Reshma Pattan Acked-by: John McNamara --- lib/librte_pdump/rte_pdump.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c index ee566cb..22ed476 100644 --- a/lib/librte_pdump/rte_pdump.c +++ b/lib/librte_pdump/rte_pdump.c @@ -677,7 +677,7 @@ pdump_create_client_socket(struct pdump_request *p) RTE_LOG(ERR, PDUMP, "Failed to get client socket path: %s:%d\n", __func__, __LINE__); - return -1; + goto exit; } addr.sun_family = AF_UNIX; addr_len = sizeof(struct sockaddr_un); @@ -728,6 +728,7 @@ pdump_create_client_socket(struct pdump_request *p) ret = server_resp.err_value; } while (0); +exit: close(socket_fd); unlink(addr.sun_path); return ret;