summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2004-04-28 07:32:58 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2004-04-28 07:32:58 +0000
commit685f47bfc5353787e499fd7d9f2fe2f9e99f8224 (patch)
treeab5dfa1f855b4c40ed5fa870d413cac7f84202dd /libexec
parent6610a5fa90fe135bc78e58071874f50188e1f318 (diff)
fd leaks; beck ok
Diffstat (limited to 'libexec')
-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) {