From 0a738590ef6acd91670406cfafc017fbef0c8d8a Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 7 Jan 2022 14:16:24 +0000 Subject: [PATCH] [Minor] Close socket on connect error --- contrib/librdns/util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/librdns/util.c b/contrib/librdns/util.c index 0f5533d53..25a7ab72f 100644 --- a/contrib/librdns/util.c +++ b/contrib/librdns/util.c @@ -599,7 +599,9 @@ rdns_ioc_new (struct rdns_server *serv, if (!rdns_ioc_tcp_connect(nioc)) { rdns_err ("cannot connect TCP socket to %s: %s", serv->name, strerror (errno)); + close (nioc->sock); free (nioc); + return NULL; } -- 2.39.5