mirror of
https://github.com/osmarks/ngircd.git
synced 2025-11-13 04:03:56 +00:00
fix fd leak (happens on failure of fork() ).
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
#include "portab.h"
|
#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 "imp.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@@ -118,6 +118,7 @@ Resolve_Addr( struct sockaddr_in *Addr )
|
|||||||
|
|
||||||
out: /* Error! */
|
out: /* Error! */
|
||||||
close( s->pipe[0] );
|
close( s->pipe[0] );
|
||||||
|
close( s->pipe[1] );
|
||||||
free( s );
|
free( s );
|
||||||
return NULL;
|
return NULL;
|
||||||
} /* Resolve_Addr */
|
} /* Resolve_Addr */
|
||||||
@@ -168,6 +169,7 @@ Resolve_Name( char *Host )
|
|||||||
|
|
||||||
out: /* Error! */
|
out: /* Error! */
|
||||||
close( s->pipe[0] );
|
close( s->pipe[0] );
|
||||||
|
close( s->pipe[1] );
|
||||||
free( s );
|
free( s );
|
||||||
return NULL;
|
return NULL;
|
||||||
} /* Resolve_Name */
|
} /* Resolve_Name */
|
||||||
|
|||||||
Reference in New Issue
Block a user