From f1a24b8d8a9366cf97d9c9ca58a74f83e9b343fc Mon Sep 17 00:00:00 2001 From: deraadt Date: Wed, 28 Apr 2004 07:32:57 +0000 Subject: fd leaks; beck ok --- libexec/spamd-setup/spamd-setup.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libexec/spamd-setup') 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) { -- cgit v1.2.3-59-g8ed1b