On 11/30/2015 06:02 PM, Jakub Hrozek wrote:
>>
>> Wouldn't it then be better to see if another same object is already in
>> the hashtable and free it before replacing?
>
> I agree it would be best. I tried that before and failed because I could not decipher
out the relation of talloc contexts.
>
> I tried that again. Seems that leaks are gone. Segfaults were not happening during my
testing.
> Code got even messier :-(
I think the code would look nice if it was placed in the else branch of
create_negcache_netgr() :-)
Done, thanks for hint.
I also don't think we need the tmp_ctx change..
I dare to disagree here. With prev. versions of patch I was experiencing segfaults. IIRC
step_context is being allocated on context of the netgroup that is freed. I also think
that it's not a good idea to allocate local data on context that does not
hold any reference to that data. But it might be matter of personal taste.
_______________________________________________
sssd-devel mailing list
sssd-devel(a)lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/sssd-devel@lists.fedorahosted.org