diff options
author | Stef Walter <stef@memberwebs.com> | 2005-03-03 19:55:34 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2005-03-03 19:55:34 +0000 |
commit | 289f38b3bd5f6b38cac46a1c65d05d4a7c14971e (patch) | |
tree | 7f684c6976938f0ee352d33df19a61bb8e7c1a10 /common | |
parent | a6de720a6c93ede0b31b1aaffa9e72c603d8191c (diff) |
Don't leak file descriptors when clamsmtpd can't connect to outgoing SMTP server [Chris Mason]
Diffstat (limited to 'common')
-rw-r--r-- | common/spio.c | 3 |
1 files changed, 3 insertions, 0 deletions
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); |