[Date Prev][Date Next] [Chronological] [Thread] [Top]

Memory leak in ldap_open?



Hi,
	This is a tentative bug report.  We found this with Purify.

	If ldap_init succeeded, and ldap_delayed_open failed, we saw a leak of the
allocated LDAP struct.
This in 1.2.11 on NT.  LDAP_REFERRALS is defined (in portable.h).

Any thoughts?

Steve

============================================================================
==============
LDAP *
ldap_open( char *host, int port )
{
 LDAP  *ld;
#ifdef LDAP_REFERRALS
 LDAPServer *srv;
#endif /* LDAP_REFERRALS */

 Debug( LDAP_DEBUG_TRACE, "ldap_open\n", 0, 0, 0 );

 if (( ld = ldap_init( host, port )) == NULL ) {
  return( NULL );
 }

 if ( ldap_delayed_open( ld ) < 0 ) {

 /******* !!!!! ld is lost? !!!!!
*************************************************/

  return( NULL );
 }

 Debug( LDAP_DEBUG_TRACE, "ldap_open successful, ld_host is %s\n",
  ( ld->ld_host == NULL ) ? "(null)" : ld->ld_host, 0, 0 );

 return( ld );
}

-------------------------
Steve Collins
APEX Voice Communications
818.379.8400 ext 113
BEGIN:VCARD
VERSION:2.1
N:Collins;Steve
FN:Steve Collins
ORG:APEX Voice Communications
TITLE:Software Development Mgr, Messaging Systems
TEL;WORK;VOICE:818.379.8400
ADR;WORK:;;15250 Ventura Blvd;Sherman Oaks;CA;91403;United States of America
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:15250 Ventura Blvd=0D=0ASherman Oaks, CA 91403=0D=0AUnited States of America
EMAIL;PREF;INTERNET:scollins@apexvoice.com
EMAIL;INTERNET:stevecollins@mail.com
REV:20001213T231802Z
END:VCARD