leaks in ldb?

tridge at samba.org tridge at samba.org
Sun Oct 15 11:36:21 GMT 2006


Andrew and Simo,

I've been chasing some memory leaks in ldb, and possibly in the
ldb_map code as used by samba3sam.c

The attached patch fixes up the leaks of struct ldb_handle, but leaks
to a valgrind error in the ldb_map code when
testprogs/ejs/samba3sam.js test is run. The error occurs on a unixName
element created in ldb_msg_el_map_remote().

I've also attached below the patch to db_wrap.c that I'm using to find
these leaks. It reports a leak if a ldb context has more than 300
blocks hanging off it when it is closed, which is a fairly reasonable
heuristic. It shows we have _lots_ of leaks, and I bet most of them
are basically because of the ldb_search() API and the fact that it
doesn't take a destination context.

Andrew, can you take a quick look at the ldb_map code and see if you
can spot why samba3sam is dying with the first patch?

Cheers, Tridge

-------------- next part --------------
A non-text attachment was scrubbed...
Name: leak.patch
Type: application/octet-stream
Size: 3543 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20061015/7b4fc04e/leak.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: detector.patch
Type: application/octet-stream
Size: 1020 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20061015/7b4fc04e/detector.obj


More information about the samba-technical mailing list