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

Re: RE: OpenLDAP & Howes/Smith Programming LDAP book...



Pay very careful attention to the documentation and when you need to
free the memory.

The original Umich3.3 code, for example, did not provide ldap_memfree
at all, and in my client code I added a
	#define ldap_memfree(p) free(p)

I still do this for OpenLDAP 1.2.x.  It there is a prototype
defined for ldap_memfree in ldap.h, but there it is not used by any
of the code (hmmmm... Kurt?).

Netscape provides an ldap_memfree() in their SDK, and one might guess
that all it does is a free(), but you cannot make that assumption.

The development version of OpenLDAP has ldap_memfree(), and it is not
at all trivial (it's possible that it ultimately results in a call to free()).

There are several things about the LDAP client API that need to be
improved (how errors are returned, for one), and you should expect
some API changes over the coming years.  Hopefully they will be
backward compatable with the existing APIs, but I don't know if that
is guaranteed.

Randy

> While on the topic and at the same time not on the topic, can I ask 
> if anyone has encountered the ldap_memfree error.
> 
> It seems that the very same examples from the book, don't compile 
> unless the lines containing ldap_memfree are commented out.
> Is there any workaround for that?
> 
> Ovanes
> 
> On Sun, 2 Jul 2000 22:26:05 -0400 MC <mcruz@rochester.rr.com> wrote:
> 
> > Thanks Allan,
> > 
> > This did the trick.
> > 
> > MCruz
> > 
> > -----Original Message-----
> > From: Allan E Johannesen [mailto:aej@WPI.EDU]
> > Sent: Sunday, July 02, 2000 6:20 PM
> > To: MC
> > Subject: OpenLDAP & Howes/Smith Programming LDAP book...
> > 
> > 
> > >>>>> "mcruz" == MC  <mcruz@rochester.rr.com> writes:
> > 
> > mcruz> Anyone has any clues?
> > 
> > When linking, are you using -lldap -llber to access the libraries?  { maybe
> > prefixed by -L/path/to/libraries }
> > 
> 
> 
> 
> 
>