]> git.sur5r.net Git - openldap/commitdiff
Plug global_host race condition/leak
authorHoward Chu <hyc@openldap.org>
Thu, 25 Jan 2007 12:16:55 +0000 (12:16 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 25 Jan 2007 12:16:55 +0000 (12:16 +0000)
servers/slapd/main.c
servers/slapd/sasl.c

index 994f9fcfa933c663d6f7dace9eeb927d7df48a6b..1b653c6d51caf6d465ec458cd3769186e15d7ee5 100644 (file)
@@ -830,6 +830,12 @@ unhandled_option:;
        }
 #endif
 
+#ifdef HAVE_CYRUS_SASL
+       if( global_host == NULL ) {
+               global_host = ldap_pvt_get_fqdn( NULL );
+       }
+#endif
+
        (void) SIGNAL( LDAP_SIGUSR1, slap_sig_wake );
        (void) SIGNAL( LDAP_SIGUSR2, slap_sig_shutdown );
 
index 756522bde5e74b8028117050782205f7b3aa4bab..0cd5afca9a5e419dc76c6e94903eeacfcfc6b18f 100644 (file)
@@ -1138,10 +1138,6 @@ int slap_sasl_open( Connection *conn, int reopen )
 
        conn->c_sasl_layers = 0;
 
-       if( global_host == NULL ) {
-               global_host = ldap_pvt_get_fqdn( NULL );
-       }
-
        /* create new SASL context */
 #if SASL_VERSION_MAJOR >= 2
        if ( conn->c_sock_name.bv_len != 0 &&