From: Howard Chu Date: Fri, 31 Mar 2006 09:33:46 +0000 (+0000) Subject: Plug leaks, fix coverity errors X-Git-Tag: OPENLDAP_REL_ENG_2_4_BP~88 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=bb9d5b11007f6b96c7ce271d411f8a3dc8c83f23;p=openldap Plug leaks, fix coverity errors --- diff --git a/servers/slurpd/config.c b/servers/slurpd/config.c index 3d7d5910b7..3654c4be42 100644 --- a/servers/slurpd/config.c +++ b/servers/slurpd/config.c @@ -182,6 +182,7 @@ slurpd_read_config( "%s: line %d: missing filename in \"include \" line\n", fname, lineno, 0 ); + fclose( fp ); return( 1 ); } LUTIL_SLASHPATH( cargv[1] ); @@ -189,6 +190,7 @@ slurpd_read_config( savelineno = lineno; if ( slurpd_read_config( savefname ) != 0 ) { + fclose( fp ); return( 1 ); } @@ -201,6 +203,7 @@ slurpd_read_config( "%s: line %d: missing file name in \"replica-pidfile \" line\n", fname, lineno, 0 ); + fclose( fp ); return( 1 ); } @@ -231,6 +234,7 @@ slurpd_read_config( "%s: line %d: missing file name in \"argsfile \" line\n", fname, lineno, 0 ); + fclose( fp ); return( 1 ); } @@ -262,6 +266,7 @@ slurpd_read_config( Debug( LDAP_DEBUG_ANY, "%s: line %d: missing interval in " "\"replicationinterval \" line\n", fname, lineno, 0 ); + fclose( fp ); return( 1 ); } @@ -270,6 +275,7 @@ slurpd_read_config( "(%d) in \"replicationinterval \" line\n", fname, lineno, c ); + fclose( fp ); return( 1 ); } @@ -571,6 +577,7 @@ parse_replica_line( fprintf( stderr, "Error: Malformed \"replica\" line in slapd config " ); fprintf( stderr, "file, missing uri hostname, line %d\n", lineno ); + ldap_free_urldesc( ludp ); return -1; } ri->ri_hostname = strdup ( ludp->lud_host ); diff --git a/servers/slurpd/ldap_op.c b/servers/slurpd/ldap_op.c index 2f5f870f03..2f19e7939d 100644 --- a/servers/slurpd/ldap_op.c +++ b/servers/slurpd/ldap_op.c @@ -669,7 +669,7 @@ do_bind( ) { int ldrc; - int do_tls = ri->ri_tls; + int do_tls; *lderr = 0; @@ -678,6 +678,8 @@ do_bind( return( BIND_ERR_BADRI ); } + do_tls = ri->ri_tls; + retry: if ( ri->ri_ldp != NULL ) { ldrc = ldap_unbind( ri->ri_ldp );