From: Pierangelo Masarati Date: Mon, 20 Mar 2006 11:57:16 +0000 (+0000) Subject: duplicate string from environment, as it may be overridden by the user (ITS#4436) X-Git-Tag: OPENLDAP_REL_ENG_2_4_BP~120 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8c9f071238cf1924bee447dc4ee9a6bf66b9ca32;p=openldap duplicate string from environment, as it may be overridden by the user (ITS#4436) --- diff --git a/libraries/libldap/init.c b/libraries/libldap/init.c index e128ddac18..bdca52823c 100644 --- a/libraries/libldap/init.c +++ b/libraries/libldap/init.c @@ -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