From 3e4fe6cc59419ce4c178e9ad31cd1069ab375e9b Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Wed, 27 Sep 2017 16:48:06 +0200 Subject: KCM: Use the right memory context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Inside the tevent request, we should use 'state' as the intermediate memory context and steal the result up to 'mem_ctx' on success. 'mem_ctx' itself should only be used to create the tevent_req as the first thing during the request creation. However, this bug is not very severe as the mem_ctx was always the KCM operation memory context, so the memory was freed when the operation terminated. Reviewed-by: Fabiano FidĂȘncio --- src/responder/kcm/kcmsrv_ccache.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/responder/kcm/kcmsrv_ccache.c b/src/responder/kcm/kcmsrv_ccache.c index d3ed10eee..63dd1f85b 100644 --- a/src/responder/kcm/kcmsrv_ccache.c +++ b/src/responder/kcm/kcmsrv_ccache.c @@ -302,7 +302,7 @@ struct tevent_req *kcm_ccdb_nextid_send(TALLOC_CTX *mem_ctx, goto immediate; } - subreq = state->db->ops->nextid_send(mem_ctx, ev, state->db, client); + subreq = state->db->ops->nextid_send(state, ev, state->db, client); if (subreq == NULL) { ret = ENOMEM; goto immediate; @@ -390,7 +390,7 @@ struct tevent_req *kcm_ccdb_list_send(TALLOC_CTX *mem_ctx, goto immediate; } - subreq = state->db->ops->list_send(mem_ctx, + subreq = state->db->ops->list_send(state, ev, state->db, client); @@ -467,7 +467,7 @@ struct tevent_req *kcm_ccdb_get_default_send(TALLOC_CTX *mem_ctx, goto immediate; } - subreq = db->ops->get_default_send(mem_ctx, ev, db, client); + subreq = db->ops->get_default_send(state, ev, db, client); if (subreq == NULL) { ret = ENOMEM; goto immediate; @@ -1034,7 +1034,7 @@ struct tevent_req *kcm_ccdb_create_cc_send(TALLOC_CTX *mem_ctx, goto immediate; } - subreq = state->db->ops->create_send(mem_ctx, + subreq = state->db->ops->create_send(state, ev, state->db, client, @@ -1129,7 +1129,7 @@ struct tevent_req *kcm_ccdb_mod_cc_send(TALLOC_CTX *mem_ctx, goto immediate; } - subreq = state->db->ops->mod_send(mem_ctx, + subreq = state->db->ops->mod_send(state, ev, state->db, client, @@ -1204,7 +1204,7 @@ struct tevent_req *kcm_ccdb_store_cred_blob_send(TALLOC_CTX *mem_ctx, goto immediate; } - subreq = state->db->ops->store_cred_send(mem_ctx, + subreq = state->db->ops->store_cred_send(state, ev, state->db, client, -- cgit