memory leak in gencache error path

Stefan (metze) Metzmacher metze at samba.org
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.
>> http://gitweb.samba.org/?p=metze/samba/wip.git;a=commitdiff;h=aba03a6c615e1fc44e865357c3402a517ec038b9
>>
>> 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?

metze

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20101222/36cb5db6/attachment.pgp>


More information about the samba-technical mailing list