]> git.sur5r.net Git - openldap/commitdiff
duplicate string from environment, as it may be overridden by the user (ITS#4436)
authorPierangelo Masarati <ando@openldap.org>
Mon, 20 Mar 2006 11:57:16 +0000 (11:57 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 20 Mar 2006 11:57:16 +0000 (11:57 +0000)
libraries/libldap/init.c

index e128ddac18a9b56468ff706c07ab9427dc0026cf..bdca52823cc9187abd34ef494ccd584ac1f577d8 100644 (file)
@@ -417,6 +417,12 @@ ldap_int_destroy_global_options(void)
                ldap_int_hostname = NULL;
        }
 #endif
+#ifdef HAVE_CYRUS_SASL
+       if ( gopts->ldo_def_sasl_authcid ) {
+               LDAP_FREE( gopts->ldo_def_sasl_authcid );
+               gopts->ldo_def_sasl_authcid = NULL;
+       }
+#endif
 }
 
 /* 
@@ -567,7 +573,7 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl )
                if( user == NULL ) user = getenv("LOGNAME");
 
                if( user != NULL ) {
-                       gopts->ldo_def_sasl_authcid = user;
+                       gopts->ldo_def_sasl_authcid = LDAP_STRDUP( user );
                }
     }
 #endif