From 6aa1aa0ebc48c14dd90648e2dbb726f0f09c4674 Mon Sep 17 00:00:00 2001 From: Ciara Power Date: Tue, 12 May 2020 16:29:00 +0100 Subject: [PATCH] telemetry: close socket on connection failure The socket fd is now being closed when the connection fails. Coverity issue: 358444 Fixes: b80fe1805eee ("telemetry: introduce backward compatibility") Signed-off-by: Ciara Power Acked-by: Kevin Laatz --- 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.20.1