From: Howard Chu Date: Tue, 4 Apr 2006 10:12:55 +0000 (+0000) Subject: Plug leak X-Git-Tag: OPENLDAP_REL_ENG_2_4_BP~30 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=548270776dece797039920523e5bb5aea4315ef6;p=openldap Plug leak --- diff --git a/servers/slapd/back-shell/fork.c b/servers/slapd/back-shell/fork.c index 5f46a2a75a..500637e035 100644 --- a/servers/slapd/back-shell/fork.c +++ b/servers/slapd/back-shell/fork.c @@ -103,7 +103,12 @@ forkandexec( if ( (*rfp = fdopen( c2p[0], "r" )) == NULL || (*wfp = fdopen( p2c[1], "w" )) == NULL ) { Debug( LDAP_DEBUG_ANY, "fdopen failed\n", 0, 0, 0 ); - close( c2p[0] ); + if ( *rfp ) { + fclose( *rfp ); + *rfp = NULL; + } else { + close( c2p[0] ); + } close( p2c[1] ); return( -1 );