- 论坛徽章:
- 0
|
我用的是openldap的2.2.19的code,移植到的c下。在做内存测试时发现,就算是只是 ldap_init,ldap_simple_bind,然后ldap_unbind,也会有内存减少。不知道有人碰到过这个现象吗?
查了下,2.2.19release里写:
Fixed back-bdb cache bugs (ITS#3356, #335 , ctxcsn memory leak
不过不知道是不是我这个情况阿。
还有个人也有泄漏现象可他用的2.0几的好象,版本比我的低啊,也没说最后到底解决没。
请高手们帮帮忙阿。
这个是我的代码行
{
LDAP *ld;
LDAPMessage *res=NULL, *e;
int i;
char *a, *dn;
BerElement *ptr;
char **vals;
if ( (ld = ldap_init("192.xxx.xxx.xxx",389 ))== NULL )
return 1;
if ( ldap_simple_bind_s( ld,"CN=nina wang,CN=Users,DC=ldap,DC=qtier,DC=com","0000" ) != LDAP_SUCCESS )
{
ldap_perror( ld, "ldap_simple_bind_s" );
return 1;
}
ldap_msgfree( res );
ldap_unbind( ld );
return 0;
} |
|