commit 0a73859: [Minor] Close socket on connect error

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Jan 7 14:21:05 UTC 2022


Author: Vsevolod Stakhov
Date: 2022-01-07 14:16:24 +0000
URL: https://github.com/rspamd/rspamd/commit/0a738590ef6acd91670406cfafc017fbef0c8d8a (HEAD -> master)

[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;
 		}
 


More information about the Commits mailing list