LDB hidden memory leaks
kamenim at gmail.com
Sun Jul 4 15:38:51 MDT 2010
As I wrote in the below mentioned thread, there are few functions in LDB
that are easy to leak memory with at present.
While this behavior is not a problem for utilities that uses LDB like ldbadd
it is a problem for Samba itself as it is supposed to be working 24/7.
In case of Samba, memory allocated in ldb_context context and not freed
leaked memory as it will go away with LDB connection, i.e. presumably never
I've pushed two approaches to the problem:
1) Introduce new functions and declare old ones as obsolete
Allocate memory in NULL context internally, so we will be able to notice,
functions are used in dangerous manner
branches affect only ldb_msg_canonicalize() function. It is basically the
for ldb_msg_diff() function.
IMO approach 1) is better one as it leaves no doubt of who the owner of the
But this approach will change LDB ABI a little, which may be not acceptable
(If I recall correctly, Simo is a strong defender of LDB ABI)
Approach 2) tries to solve the problem without ABI change but I think it
will lead us
(or other LDB users) to the same problem soon or later.
So, what do you think?
Samba Team Developer http://samba.org
CISCO SYSTEMS BULGARIA EOOD
kamen.mazdrashki at postpath.com
More information about the samba-technical