summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS1
-rw-r--r--ChangeLog2
-rw-r--r--common/spio.c3
3 files changed, 6 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
index e20ea3b..a7f2ba8 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -12,3 +12,4 @@ Jasper Slits <jasper@insiders.nl>
Yamamoto Takao <takao@oakat.org>
Ben Mesman <ben@bncnetservice.nl>
Olivier Beyssac <ob@r14.freenix.org>
+Chris Mason <Chris.Mason@vodafone.com>
diff --git a/ChangeLog b/ChangeLog
index 6d1e395..9242981 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
1.4
- Documentation fixes [Sean Franklin]
+ - Don't leak file descriptors when clamsmtpd can't connect to outgoing
+ SMTP server [Chris Mason]
1.3 [2005-01-27]
- Fixed crasher when outgoing connection couldn't be established
diff --git a/common/spio.c b/common/spio.c
index f43988a..67e0405 100644
--- a/common/spio.c
+++ b/common/spio.c
@@ -155,7 +155,10 @@ int spio_connect(spctx_t* ctx, spio_t* io, const struct sockaddr_any* sany,
fcntl(fd, F_SETFD, fcntl(fd, F_GETFD, 0) | FD_CLOEXEC);
if(connect(fd, &SANY_ADDR(*sany), SANY_LEN(*sany)) == -1)
+ {
+ close_raw(&fd);
RETURN(-1);
+ }
spio_attach(ctx, io, fd, NULL);