]> 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 227617704cb96ff7a2fea78d6138a628bbb20e99..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);
        }
 
@@ -459,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