memory leak in gencache error path

Stefan (metze) Metzmacher metze at
Wed Dec 22 04:51:45 MST 2010

Hi Volker,

>> while testing my "net ads dns register" changes I noticed some memory leaks.
>> One was in the gencache code, I've fixed it here, but I'm unsure if this
>> is correct.
>> Do we have callers which rely on getting the blob of expired entries?
> What about the idmap cache in the offline case?

From reading the code it uses gencache_get().

And gencache_get() calls gencache_get_data_blob().
Both return false in case the entry has expired.
gencache_get_data_blob() does an implicit gencache_set(keystr, "", 0)
in that case before returning false.

I looked through all callers of gencache_get_data_blob()
and it seems that none expects blob to be filled if it returns false.

Do you think it's ok to push my fix?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the samba-technical mailing list