]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/init.c
Don't copy and leak user; it's an env var so just use it directly.
[openldap] / libraries / libldap / init.c
index 54c6ba5a4d1f4aa9f96dd1c9464819a97951631f..e05ade2d4cbb86f1c62219b9e90b1abf4e51d06e 100644 (file)
@@ -263,11 +263,11 @@ static void openldap_ldap_init_w_userconf(const char *file)
                /* we assume UNIX path syntax is used... */
 
                /* try ~/file */
-               sprintf(path, "%s/%s", home, file);
+               sprintf(path, "%s%s%s", home, LDAP_DIRSEP, file);
                openldap_ldap_init_w_conf(path, 1);
 
                /* try ~/.file */
-               sprintf(path, "%s/.%s", home, file);
+               sprintf(path, "%s%s.%s", home, LDAP_DIRSEP, file);
                openldap_ldap_init_w_conf(path, 1);
        }
 
@@ -399,6 +399,7 @@ void ldap_int_initialize_global_options( struct ldapoptions *gopts, int *dbglvl
 #ifdef LDAP_CONNECTIONLESS
        gopts->ldo_peer = NULL;
        gopts->ldo_cldapdn = NULL;
+       gopts->ldo_is_udp = 0;
 #endif
 
 #ifdef HAVE_CYRUS_SASL
@@ -431,6 +432,8 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl )
                return;
        }
 
+       ldap_int_error_init();
+
 #if defined(LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND) \
        || defined(HAVE_TLS) || defined(HAVE_CYRUS_SASL)
        ldap_int_hostname = ldap_pvt_get_fqdn( ldap_int_hostname );
@@ -456,8 +459,7 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl )
                if( user == NULL ) user = getenv("LOGNAME");
 
                if( user != NULL ) {
-                       /* this value is leaked, need at_exit() handler */
-                       gopts->ldo_def_sasl_authcid = LDAP_STRDUP( user );
+                       gopts->ldo_def_sasl_authcid = user;
                }
     }
 #endif