[SSSD] [PATCH] TEST: recent_valid filter testing

Petr Cech pcech at redhat.com
Tue Nov 10 14:51:23 UTC 2015


On 11/10/2015 08:37 AM, Lukas Slebodnik wrote:
> On (10/11/15 08:29), Pavel Reichl wrote:
>>
>>
>> On 11/05/2015 05:29 PM, Petr Cech wrote:
>>> +void test_groups_by_recent_filter_valid(void **state)
>>> +{
>>> +    struct cache_req_test_ctx *test_ctx = NULL;
>>> +    TALLOC_CTX *req_mem_ctx = NULL;
>>> +    struct tevent_req *req = NULL;
>>> +    const char **group_names = NULL;
>>> +    const char **ldb_results = NULL;
>>> +    const char *ldbname = NULL;
>>> +    void *tmp_ctx = NULL;
>> Could you use TALLOC_CTX?
>>
> Why do we need two different talloc context in a test?
> "TALLOC_CTX *req_mem_ctx", "void *tmp_ctx"
>
> If we properly release resources we can use single talloc context.
> It's the best way how to catch memory leaks.
>
> LS

Right, I will change void *tmp_ctx to TALLOC_CTX *tmp_ctx and I will 
create it under req_mem_ctx. I feel it will be more clear and readable.

Petr


More information about the sssd-devel mailing list