]> git.sur5r.net Git - openldap/commitdiff
Plug leaks, fix coverity errors
authorHoward Chu <hyc@openldap.org>
Fri, 31 Mar 2006 09:33:46 +0000 (09:33 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 31 Mar 2006 09:33:46 +0000 (09:33 +0000)
servers/slurpd/config.c
servers/slurpd/ldap_op.c

index 3d7d5910b768973d778258727eb6d911a8bfe8ac..3654c4be42b0797a4bab74281b18658451dbfdc0 100644 (file)
@@ -182,6 +182,7 @@ slurpd_read_config(
                                        "%s: line %d: missing filename in \"include <filename>\" 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 <file>\" line\n",
                                        fname, lineno, 0 );
 
+                               fclose( fp );
                                return( 1 );
                        }
 
@@ -231,6 +234,7 @@ slurpd_read_config(
                                        "%s: line %d: missing file name in \"argsfile <file>\" 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 <seconds>\" line\n",
                                        fname, lineno, 0 );
+                               fclose( fp );
                                return( 1 );
                        }
 
@@ -270,6 +275,7 @@ slurpd_read_config(
                                        "(%d) in \"replicationinterval <seconds>\" 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 );
index 2f5f870f03070fff844ae9c4f36505137b5f9c34..2f19e7939df907a644a0b5483abd661734dba502 100644 (file)
@@ -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 );