]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/daemon.c
ITS#4832 fix unint'd var
[openldap] / servers / slapd / daemon.c
index e215347f4c15156c13dbe842a365470f34ac5752..9f86d3d13035d64fe8cf4aec1f7afd065ed3627e 100644 (file)
@@ -583,28 +583,17 @@ slapd_slp_init( const char* urls )
        /* find and expand INADDR_ANY URLs */
        for ( i = 0; slapd_srvurls[i] != NULL; i++ ) {
                if ( strcmp( slapd_srvurls[i], "ldap:///" ) == 0 ) {
-                       char *host = ldap_pvt_get_fqdn( NULL );
-                       if ( host != NULL ) {
-                               slapd_srvurls[i] = (char *) ch_realloc( slapd_srvurls[i],
-                                       strlen( host ) +
-                                       sizeof( LDAP_SRVTYPE_PREFIX ) );
-                               strcpy( lutil_strcopy(slapd_srvurls[i],
-                                       LDAP_SRVTYPE_PREFIX ), host );
-
-                               ch_free( host );
-                       }
-
+                       slapd_srvurls[i] = (char *) ch_realloc( slapd_srvurls[i],
+                               strlen( global_host ) +
+                               sizeof( LDAP_SRVTYPE_PREFIX ) );
+                       strcpy( lutil_strcopy(slapd_srvurls[i],
+                               LDAP_SRVTYPE_PREFIX ), global_host );
                } else if ( strcmp( slapd_srvurls[i], "ldaps:///" ) == 0 ) {
-                       char *host = ldap_pvt_get_fqdn( NULL );
-                       if ( host != NULL ) {
-                               slapd_srvurls[i] = (char *) ch_realloc( slapd_srvurls[i],
-                                       strlen( host ) +
-                                       sizeof( LDAPS_SRVTYPE_PREFIX ) );
-                               strcpy( lutil_strcopy(slapd_srvurls[i],
-                                       LDAPS_SRVTYPE_PREFIX ), host );
-
-                               ch_free( host );
-                       }
+                       slapd_srvurls[i] = (char *) ch_realloc( slapd_srvurls[i],
+                               strlen( global_host ) +
+                               sizeof( LDAPS_SRVTYPE_PREFIX ) );
+                       strcpy( lutil_strcopy(slapd_srvurls[i],
+                               LDAPS_SRVTYPE_PREFIX ), global_host );
                }
        }