diff --git a/src/auth-ldap.m b/src/auth-ldap.m index ca90dee..7ef7330 100644 --- a/src/auth-ldap.m +++ b/src/auth-ldap.m @@ -545,7 +545,6 @@ static int handle_client_connect_disconnect(ldap_ctx *ctx, TRLDAPConnection *lda pool = [[TRAutoreleasePool alloc] init]; username = get_env("username", envp); - TRString *userName=[[TRString alloc]initWithCString: username]; password = get_env("password", envp); remoteAddress = get_env("ifconfig_pool_remote_ip", envp); @@ -556,6 +555,8 @@ static int handle_client_connect_disconnect(ldap_ctx *ctx, TRLDAPConnection *lda goto cleanup; } + TRString *userName=[[TRString alloc]initWithCString: username]; + /* Create an LDAP connection */ if (!(ldap = connect_ldap(ctx->config))) { [TRLog error: "LDAP connect failed."];