]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Close socket on connect error
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 7 Jan 2022 14:16:24 +0000 (14:16 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 7 Jan 2022 14:16:24 +0000 (14:16 +0000)
contrib/librdns/util.c

index 0f5533d5304246b84fef65564d2e48b1f3815308..25a7ab72f6767fd6fe85d9125743eaa3c5692d79 100644 (file)
@@ -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;
                }