summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/bounce.c
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2011-03-21 13:06:26 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2011-03-21 13:06:26 +0000
commit8fb17479cf28187985f559241e3c8bb097b11caa (patch)
tree1807dc6a3b2aab03745c7f52fd1155374bf5f014 /usr.sbin/smtpd/bounce.c
parentca5c0f6c2e3326df90f7718407975ba00575984b (diff)
do not close msgfd in bounce_session(), it is closed by client_close()
Diffstat (limited to 'usr.sbin/smtpd/bounce.c')
-rw-r--r--usr.sbin/smtpd/bounce.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/smtpd/bounce.c b/usr.sbin/smtpd/bounce.c
index 13c5dedc97c..7d4aada11e8 100644
--- a/usr.sbin/smtpd/bounce.c
+++ b/usr.sbin/smtpd/bounce.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bounce.c,v 1.24 2010/11/28 13:56:43 gilles Exp $ */
+/* $OpenBSD: bounce.c,v 1.25 2011/03/21 13:06:25 gilles Exp $ */
/*
* Copyright (c) 2009 Gilles Chehade <gilles@openbsd.org>
@@ -55,10 +55,12 @@ bounce_session(struct smtpd *env, int fd, struct message *messagep)
/* get message content */
if ((msgfd = queue_open_message_file(messagep->message_id)) == -1)
goto fail;
-
+
/* init smtp session */
- if ((cc = calloc(1, sizeof(*cc))) == NULL)
+ if ((cc = calloc(1, sizeof(*cc))) == NULL) {
+ close(msgfd);
goto fail;
+ }
cc->pcb = client_init(fd, msgfd, env->sc_hostname, 1);
cc->env = env;
cc->m = *messagep;
@@ -105,7 +107,6 @@ bounce_session(struct smtpd *env, int fd, struct message *messagep)
return 1;
fail:
- close(msgfd);
if (cc && cc->pcb)
client_close(cc->pcb);
free(cc);