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

Core dump on process exit (ITS#1563)

Full_Name: Rolandas Naujikas
Version: 2.0.21
OS: FreeBSD 4.4 (4.5) RELEASE
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (

>Date: Wed, 30 Jun 1999 15:41:12 -0700
>To: tim@cmark.com
>From: "Kurt D. Zeilenga" <Kurt@OpenLDAP.Org>
>Subject: Re: Fix for Memory Leak  (ITS#217)
>Cc: openldap-its@OpenLDAP.Org
>At 10:38 PM 6/30/99 GMT, tim@cmark.com wrote:
>>Full_Name: Tim Bowman
>>Version: 1.2.3
>>OS: Linux & NT
>>URL: ftp://ftp.openldap.org/incoming/
>>Submission from: (NULL) (
>>There is a memory leak due to the global openldap_ldap_global_options struct
>>(in init.c) having two members ldo_defbase & ldo_defhost which are
>malloced if
>>an ldap.conf file is read.  This is a one-time allocation, so it's only a
>>for OSs that don't free the memory.
>The simple (and correct) fix is for the library to register an atexit()
>handler to deallocate the two strings...

This doesn't work because shared libraries can be unloaded early than process
exits. Example is pam_ldap (134 & 136) module from www.padl.com.

>> ldap needs an ldap_uninit to pair with ldap_init.
>ldap_init/ldap_open are paired with ldap_unbind.