From 548270776dece797039920523e5bb5aea4315ef6 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 4 Apr 2006 10:12:55 +0000 Subject: [PATCH] Plug leak --- servers/slapd/back-shell/fork.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 ); -- 2.39.5