From: Ciara Power Date: Tue, 12 May 2020 15:29:00 +0000 (+0100) Subject: telemetry: close socket on connection failure X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=6aa1aa0ebc48c14dd90648e2dbb726f0f09c4674;p=dpdk.git 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 --- 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,