Issue 379 - slapd memory leaks
Summary: slapd memory leaks
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: 1999-11-20 23:01 UTC by jromine@campuspipeline.com
Modified: 1999-12-02 23:25 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 jromine@campuspipeline.com 1999-11-20 23:01:29 UTC
Full_Name: Jeff Romine
Version: OPENLDAP_REL_ENG_2_0_ALPHA3
OS: Solaris 2.7
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (206.81.132.94)



Found a couple of memory leaks in slapd using Purify.
cvs diffs of my fixes:


Index: controls.c
===================================================================
RCS file: /repo/OpenLDAP/pkg/ldap/servers/slapd/controls.c,v
retrieving revision 1.6.2.2
diff -r1.6.2.2 controls.c
65a66
> #if 0	
68c69,70
< 
---
> #endif	
> 	    
76d77
< 
Index: back-ldbm/alias.c
===================================================================
RCS file: /repo/OpenLDAP/pkg/ldap/servers/slapd/back-ldbm/alias.c,v
retrieving revision 1.23.2.1
diff -r1.23.2.1 alias.c
207a208
> 	charray_free(dnlist);

Comment 1 Howard Chu 1999-12-02 03:02:46 UTC
Just for the record... The fix for alias.c is applied in rev 1.25. It doesn't
look like controls.c has a bug.
Comment 2 Howard Chu 1999-12-02 03:03:04 UTC
changed state Open to Feedback
Comment 3 jromine@campuspipeline.com 1999-12-02 05:10:14 UTC


Howard Chu wrote:

> Just for the record... The fix for alias.c is applied in rev 1.25. It doesn't
> look like controls.c has a bug.

Yes, I saw that the alias.c fix got committed.   Thank you.
controls.c definitely has a small memory leak.  A pointer size
piece of memory gets allocated on line 68:

68:   *ctrls = ch_malloc( 1 * sizeof(LDAPControl *) );

This pointer is then set to NULL on the next active line, line 78:

78:  ctrls[nctrls] = NULL;

since nctrls is initialized to 0 and this is the first use of it in the
function.

-Jeff




Comment 4 Howard Chu 1999-12-02 23:24:52 UTC
OK. The bug in slapd/controls.c is fixed in rev 1.10. The same bug in
libldap/controls.c is fixed in rev 1.21
Comment 5 Howard Chu 1999-12-02 23:25:09 UTC
changed state Feedback to Closed
moved from Incoming to Software Bugs