>From 688e554251c8bef94f0e089729a3ac0daaeece8b Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Tue, 9 Sep 2014 10:45:40 +0200 Subject: [PATCH] LDAP: Always free talloc_req On failure, the subreq wasn't freed, which was not a big deal given the parent request would free the subreq anyway, but it's better to follow the usual pattern. --- src/providers/ldap/sdap_access.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/providers/ldap/sdap_access.c b/src/providers/ldap/sdap_access.c index dda60fc2886171671f2ce7b511693ab920faa1ec..e09e6b8fe55e8e8bae9ff7f46e815595cb938971 100644 --- a/src/providers/ldap/sdap_access.c +++ b/src/providers/ldap/sdap_access.c @@ -1461,14 +1461,13 @@ static void sdap_access_lock_get_lockout_done(struct tevent_req *subreq) state = tevent_req_data(req, struct sdap_access_lock_req_ctx); ret = sdap_get_generic_recv(subreq, state, &num_results, &results); + talloc_zfree(subreq); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, "Cannot retrieve ppolicy\n"); ret = ERR_NETWORK_IO; goto done; } - talloc_zfree(subreq); - /* Check the number of responses we got * If it's exactly 1, we passed the check * If it's < 1, we failed the check -- 1.9.3