From: Reshma Pattan Date: Mon, 4 Jul 2016 16:17:29 +0000 (+0100) Subject: pdump: close client socket on error X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=2641a532ed86f33913ac0379ec6b3fa97a27c137;p=dpdk.git pdump: close client socket on error 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 --- diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c index ee566cb2f4..22ed476916 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;