]> git.sur5r.net Git - openldap/commitdiff
in case of early exit, frontendDB might be uninitialized
authorPierangelo Masarati <ando@openldap.org>
Tue, 27 Jul 2004 21:15:33 +0000 (21:15 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 27 Jul 2004 21:15:33 +0000 (21:15 +0000)
servers/slapd/config.c

index 71fb0dcb486be4b107ff26d58f5d32c417eab7bb..9868742c961c977b63355f76a2b77af642a8fd2c 100644 (file)
@@ -3058,8 +3058,15 @@ void
 config_destroy( )
 {
        ucdata_unload( UCDATA_ALL );
-       free( frontendDB->be_schemandn.bv_val );
-       free( frontendDB->be_schemadn.bv_val );
+       if ( frontendDB ) {
+               /* NOTE: in case of early exit, frontendDB can be NULL */
+               if ( frontendDB->be_schemandn.bv_val )
+                       free( frontendDB->be_schemandn.bv_val );
+               if ( frontendDB->be_schemadn.bv_val )
+                       free( frontendDB->be_schemadn.bv_val );
+               if ( frontendDB->be_acl )
+                       acl_destroy( frontendDB->be_acl, NULL );
+       }
        free( line );
        if ( slapd_args_file )
                free ( slapd_args_file );
@@ -3067,7 +3074,6 @@ config_destroy( )
                free ( slapd_pid_file );
        if ( default_passwd_hash )
                ldap_charray_free( default_passwd_hash );
-       acl_destroy( frontendDB->be_acl, NULL );
 }
 
 static int