[Fedora-directory-devel] Please Review: (440474) Various memory leaks in memberOf plug-in

Nathan Kinder nkinder at redhat.com
Thu Apr 3 18:23:09 UTC 2008


https://bugzilla.redhat.com/show_bug.cgi?id=440474
Resolves: bug 440474
Bug Description: A number of memory leaks in the memberOf plug-in occur 
during
  various operations on member attributes.  These leaks were discovered 
using
  valgrind to run ns-slapd.
Reviewed by: ???
Files: see diff
Branch: HEAD
Fix Description: We were allocating a Slapi_Mods in the modify callback 
and never
  calling slapi_mods_free() would cause a double free. This is because 
we are
  initialing the Slapi_Mods by passing in the LDAPMod array from 
SLAPI_MODIFY_MODS
  in the pblock.  This will make slapi_mods_free() do a free of the 
LDAPMod elements,
  but do_modify() is responsible for freeing the LDAPMod array in the 
pblock.  The
  solution is to initialize the Slapi_Mods by reference so 
slapi_mods_free() doesn't
  try to free the LDAPMod array.

  There were 4 places where we were allocating a Slapi_Entry by calling
  slapi_search_internal_get_entry(), but never freeing the entry when we 
were
  finished with it.

  We were allocating two Slapi_Value arrays with slapi_ch_malloc(), but were
  never calling slapi_ch_free() when we were finished.
Platforms tested: RHEL5.1 x86_64
Flag Day: No.
Doc impact: None.
https://bugzilla.redhat.com/attachment.cgi?id=300297&action=diff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3241 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/fedora-directory-devel/attachments/20080403/3049c74a/attachment.bin>


More information about the Fedora-directory-devel mailing list