summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Longeau <chl@cvs.openbsd.org>2012-09-26 21:06:46 +0000
committerCharles Longeau <chl@cvs.openbsd.org>2012-09-26 21:06:46 +0000
commit7bfd12bc5fb78297658b726a9743fcc6abc23eeb (patch)
treeab7d43903f7b7f0ca1071c3d37c369c696185322
parent06581330965bd9f1e6f774a3d405d9671c644f26 (diff)
fix memory leak in case of fdopen() failure
ok eric@ gilles@
-rw-r--r--usr.sbin/smtpd/bounce.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/bounce.c b/usr.sbin/smtpd/bounce.c
index 01e8fb06ef4..cf223196d89 100644
--- a/usr.sbin/smtpd/bounce.c
+++ b/usr.sbin/smtpd/bounce.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bounce.c,v 1.47 2012/08/18 15:39:26 eric Exp $ */
+/* $OpenBSD: bounce.c,v 1.48 2012/09/26 21:06:45 chl Exp $ */
/*
* Copyright (c) 2009 Gilles Chehade <gilles@openbsd.org>
@@ -160,6 +160,7 @@ bounce_run(uint64_t id, int fd)
if ((bounce->msgfp = fdopen(msgfd, "r")) == NULL) {
log_warn("bounce_run: fdopen");
bounce_status(bounce, "error %i in fdopen", errno);
+ bounce_free(bounce);
close(msgfd);
return;
}