From: Vsevolod Stakhov Date: Fri, 7 Jan 2022 14:16:24 +0000 (+0000) Subject: [Minor] Close socket on connect error X-Git-Tag: 3.2~118 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0a738590ef6acd91670406cfafc017fbef0c8d8a;p=rspamd.git [Minor] Close socket on connect error --- 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; }