Plug leak

This commit is contained in:
Howard Chu 2006-04-04 10:12:55 +00:00
parent 272211fbcd
commit 548270776d

View File

@ -103,7 +103,12 @@ forkandexec(
if ( (*rfp = fdopen( c2p[0], "r" )) == NULL || (*wfp = fdopen( p2c[1], if ( (*rfp = fdopen( c2p[0], "r" )) == NULL || (*wfp = fdopen( p2c[1],
"w" )) == NULL ) { "w" )) == NULL ) {
Debug( LDAP_DEBUG_ANY, "fdopen failed\n", 0, 0, 0 ); Debug( LDAP_DEBUG_ANY, "fdopen failed\n", 0, 0, 0 );
if ( *rfp ) {
fclose( *rfp );
*rfp = NULL;
} else {
close( c2p[0] ); close( c2p[0] );
}
close( p2c[1] ); close( p2c[1] );
return( -1 ); return( -1 );