]> arthur.barton.de Git - ngircd.git/commitdiff
fix fd leak (happens on failure of fork() ).
authorFlorian Westphal <fw@strlen.de>
Fri, 2 Sep 2005 21:47:30 +0000 (21:47 +0000)
committerFlorian Westphal <fw@strlen.de>
Fri, 2 Sep 2005 21:47:30 +0000 (21:47 +0000)
src/ngircd/resolve.c

index a5ba32e4cd5cc32ca1bf83725702e98b013fd58c..723880f662ac846e53f3e74718d9dca75bfeb4dd 100644 (file)
@@ -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 <assert.h>
@@ -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 */