Bug 183903

Summary: Memory leak in ldbm_config.c:replace_ldbm_config_value
Product: [Retired] 389 Reporter: Rich Megginson <rmeggins>
Component: Directory ServerAssignee: Rich Megginson <rmeggins>
Status: CLOSED CURRENTRELEASE QA Contact: Viktor Ashirov <vashirov>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-07 16:35:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 152373, 208654, 240316    

Description Rich Megginson 2006-03-03 15:46:59 UTC
I'm pretty sure this function needs to call slapi_mods_done(&smods) after the
internal modify operation.

Comment 1 Rich Megginson 2006-10-12 20:58:00 UTC
*** ldbm_config.c.~1.6.~	2006-04-11 09:48:11.000000000 -0600
--- ldbm_config.c	2006-10-12 15:00:22.000000000 -0600
***************
*** 1760,1764 ****
--- 1760,1765 ----
          		   slapi_mods_get_ldapmods_byref(&smods),
          		   NULL, NULL, li->li_identity, 0);
      slapi_modify_internal_pb(&pb);
+     slapi_mods_done(&smods);
      pblock_done(&pb);
  }


Comment 2 Noriko Hosoi 2006-10-12 21:17:55 UTC
Yep, it's a leak...  Good catch!

Comment 3 Rich Megginson 2006-10-12 21:21:41 UTC
Reviewed by: nhosoi (Thanks!)
Files: see diff
Branch: HEAD
Fix Description: Just needed to call slapi_mods_done(&smods) after the call to
slapi_modify_internal_pb().  This is the same as in the other places in the
server that perform an internal modify operation.
Platforms tested: RHEL4
Flag Day: no
Doc impact: no

Checking in ldbm_config.c;
/cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_config.c,v  <-- 
ldbm_config.c
new revision: 1.7; previous revision: 1.6
done


Comment 4 Rich Megginson 2008-01-03 20:54:41 UTC
Memory leak not seen anymore by valgrind.