aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/librdns/util.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2022-01-07 14:16:24 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2022-01-07 14:16:24 +0000
commit0a738590ef6acd91670406cfafc017fbef0c8d8a (patch)
treec527ecd8515ed5e8dbd03b5cb58806bf3785e597 /contrib/librdns/util.c
parentc790a8db04ff2bd26e7a7606aa31d59647567531 (diff)
downloadrspamd-0a738590ef6acd91670406cfafc017fbef0c8d8a.tar.gz
rspamd-0a738590ef6acd91670406cfafc017fbef0c8d8a.zip
[Minor] Close socket on connect error
Diffstat (limited to 'contrib/librdns/util.c')
-rw-r--r--contrib/librdns/util.c2
1 files changed, 2 insertions, 0 deletions
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;
}