Bug 183903 - Memory leak in ldbm_config.c:replace_ldbm_config_value
Memory leak in ldbm_config.c:replace_ldbm_config_value
Status: CLOSED CURRENTRELEASE
Product: 389
Classification: Community
Component: Directory Server (Show other bugs)
1.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Rich Megginson
Viktor Ashirov
:
Depends On:
Blocks: 152373 fds103trackingbug 240316
  Show dependency treegraph
 
Reported: 2006-03-03 10:46 EST by Rich Megginson
Modified: 2015-12-07 11:35 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-12-07 11:35:30 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Rich Megginson 2006-03-03 10:46:59 EST
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 16:58:00 EDT
*** 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 17:17:55 EDT
Yep, it's a leak...  Good catch!
Comment 3 Rich Megginson 2006-10-12 17:21:41 EDT
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 15:54:41 EST
Memory leak not seen anymore by valgrind.

Note You need to log in before you can comment on or make changes to this bug.