From 6444442931c537eb3c8f816ff0ab3f4602ccc767 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Fri, 2 Sep 2005 21:47:30 +0000 Subject: [PATCH] fix fd leak (happens on failure of fork() ). --- src/ngircd/resolve.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ngircd/resolve.c b/src/ngircd/resolve.c index a5ba32e4..723880f6 100644 --- a/src/ngircd/resolve.c +++ b/src/ngircd/resolve.c @@ -14,7 +14,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: resolve.c,v 1.17 2005/07/31 20:13:08 alex Exp $"; +static char UNUSED id[] = "$Id: resolve.c,v 1.18 2005/09/02 21:47:30 fw Exp $"; #include "imp.h" #include @@ -118,6 +118,7 @@ Resolve_Addr( struct sockaddr_in *Addr ) out: /* Error! */ close( s->pipe[0] ); + close( s->pipe[1] ); free( s ); return NULL; } /* Resolve_Addr */ @@ -168,6 +169,7 @@ Resolve_Name( char *Host ) out: /* Error! */ close( s->pipe[0] ); + close( s->pipe[1] ); free( s ); return NULL; } /* Resolve_Name */