Issue 674 - Memory leak in ldbm backend of slapd
Summary: Memory leak in ldbm backend of slapd
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-08-18 14:42 UTC by tjeerd.van.lemel@cmg.nl
Modified: 2014-08-01 21:05 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description tjeerd.van.lemel@cmg.nl 2000-08-18 14:42:29 UTC
Full_Name: Tjeerd van Lemel
Version: 2.0 beta
OS: Tru64 Unix 4.0
URL: ftp://ftp.openldap.org/incoming/Tjeerd-van-Lemel-000818.1
Submission from: (NULL) (195.109.155.66)


The function index_param() in servers/slapd/back_ldbm/index.c assigns *prefixp
with ber_bvstrdup() allocated data if it returns successfully. This function is
called from 3 places in servers/slapd/back_ldbm/filterindex.c (and from nowhere
else). The allocated data (pointed to by the variable 'prefix') is never freed.
This freeing should *always* be done (with ber_bvfree()) if index_param()
returns LDAP_SUCCESS, even if the calling functions itself doesn't return
successfully after the call of index_param(). 
Comment 1 Kurt Zeilenga 2000-08-18 14:53:08 UTC
I believe that's fixed on both HEAD and OPENLDAP_REL_ENG_2 branches.
Please view latest version filterentry.c available at:

http://www.openldap.org/devel/cvsweb.cgi/servers/slapd/back-ldbm/filterindex.c

or directly from CVS.

At 02:42 PM 8/18/00 +0000, tjeerd.van.lemel@cmg.nl wrote:
>Full_Name: Tjeerd van Lemel
>Version: 2.0 beta
>OS: Tru64 Unix 4.0
>URL: ftp://ftp.openldap.org/incoming/Tjeerd-van-Lemel-000818.1
>Submission from: (NULL) (195.109.155.66)
>
>
>The function index_param() in servers/slapd/back_ldbm/index.c assigns *prefixp
>with ber_bvstrdup() allocated data if it returns successfully. This function is
>called from 3 places in servers/slapd/back_ldbm/filterindex.c (and from nowhere
>else). The allocated data (pointed to by the variable 'prefix') is never freed.
>This freeing should *always* be done (with ber_bvfree()) if index_param()
>returns LDAP_SUCCESS, even if the calling functions itself doesn't return
>successfully after the call of index_param(). 

Comment 2 Kurt Zeilenga 2000-08-18 16:29:47 UTC
changed notes
changed state Open to Closed
moved from Incoming to Development
Comment 3 OpenLDAP project 2014-08-01 21:05:27 UTC
previously fixed.