summaryrefslogtreecommitdiffstats
path: root/libexec/spamd-setup
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2004-04-28 07:32:57 +0000
committerderaadt <deraadt@openbsd.org>2004-04-28 07:32:57 +0000
commitf1a24b8d8a9366cf97d9c9ca58a74f83e9b343fc (patch)
tree2bcbe639ca124213483c0582b9dc1f8b4f14101d /libexec/spamd-setup
parentadd SendEnv to -o list; (diff)
downloadwireguard-openbsd-f1a24b8d8a9366cf97d9c9ca58a74f83e9b343fc.tar.xz
wireguard-openbsd-f1a24b8d8a9366cf97d9c9ca58a74f83e9b343fc.zip
fd leaks; beck ok
Diffstat (limited to 'libexec/spamd-setup')
-rw-r--r--libexec/spamd-setup/spamd-setup.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libexec/spamd-setup/spamd-setup.c b/libexec/spamd-setup/spamd-setup.c
index 3ead7eb5523..57c0e4364a0 100644
--- a/libexec/spamd-setup/spamd-setup.c
+++ b/libexec/spamd-setup/spamd-setup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spamd-setup.c,v 1.17 2004/02/26 08:18:56 deraadt Exp $ */
+/* $OpenBSD: spamd-setup.c,v 1.18 2004/04/28 07:32:57 deraadt Exp $ */
/*
* Copyright (c) 2003 Bob Beck. All rights reserved.
@@ -612,8 +612,10 @@ configure_spamd(u_short dport, char *name, char *message,
if (connect(s, (struct sockaddr *)&sin, sizeof sin) == -1)
return(-1);
sdc = fdopen(s, "w");
- if (sdc == NULL)
+ if (sdc == NULL) {
+ close(s);
return(-1);
+ }
fprintf(sdc, "%s", name);
do_message(sdc, message);
while (*blacklists != NULL) {