about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2006-09-16 12:22:09 +0000
committerFlorian Westphal <fw@strlen.de>2006-09-16 12:22:09 +0000
commite426c131c7260631b2536845159909da2dc92edc (patch)
treea5820fd5a26db2489f3c80ed2a07bd67822d7362
parentb9661ae65d0bbd2a12bafd2f0d45e2b42261e4d3 (diff)
downloadngircd-e426c131c7260631b2536845159909da2dc92edc.tar.gz
ngircd-e426c131c7260631b2536845159909da2dc92edc.zip
fix embarassing fileptr leak
-rw-r--r--src/ngircd/irc-info.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ngircd/irc-info.c b/src/ngircd/irc-info.c
index 37afbd3c..62b238ee 100644
--- a/src/ngircd/irc-info.c
+++ b/src/ngircd/irc-info.c
@@ -14,7 +14,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: irc-info.c,v 1.33 2006/05/10 21:24:01 alex Exp $";
+static char UNUSED id[] = "$Id: irc-info.c,v 1.34 2006/09/16 12:22:09 fw Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -910,8 +910,10 @@ IRC_Show_MOTD( CLIENT *Client )
 		return IRC_WriteStrClient( Client, ERR_NOMOTD_MSG, Client_ID( Client ) );
 	}
 
-	if (!Show_MOTD_Start( Client ))
-		return DISCONNECTED;
+	if (!Show_MOTD_Start( Client )) {
+		fclose(fd);
+		return false;
+	}
 
 	while (fgets( line, (int)sizeof line, fd )) {
 		ngt_TrimLastChr( line, '\n');