ldapauth memory leak fixed

Привет !
Исправил старую багу по утечки памяти в плагине .. теперь вообще не
течет ,
глупая ошибка.. Вот так 3,5  года не попрограммируеш , срузу ошибку
найдеш :)

--
Kirill Lopuchov
This commit is contained in:
Vladimir Dubrovin committed 2014-05-04 23:10:14 +04:00
1 parent 9ab9c2524b
commit e3144dc61b
2 files changed
+11 -13

No files matched your search

+11 -3
View File
@@ -121,6 +121,9 @@ static int ldapfunc(struct clientparam *param)
int rc = -1;
char tmpbuf[1024];
/* test proxy user auth ------------------------*/
if(!param->username || !param->password) return 4;
if(strlen(param->password)==0) return 4;
/* init ldap ---------------------- */
ld = ldap_init( ldap_serv, 389 );
@@ -131,9 +134,6 @@ static int ldapfunc(struct clientparam *param)
return 7;
}
/* test proxy user auth ------------------------*/
if(!param->username || !param->password) return 4;
if(strlen(param->password)==0) return 4;
/* this code for Active Directory LDAP catalog :(
detail see documentation for plugin */
@@ -161,6 +161,14 @@ static int ldapfunc(struct clientparam *param)
ldap_unbind_s(ld);
ld = ldap_init( ldap_serv, 389 );
if ( ld == NULL )
{
param->srv->logfunc(param,"Error ldap_init: No init lib ldap");
/*ldap_perror( ld, "Error ldap_init" ); */
return 7;
}
rc = ldap_bind_s( ld, ldap_user, ldap_pass, LDAP_AUTH_SIMPLE );
if ( rc != LDAP_SUCCESS )