summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2017-09-27 16:48:06 +0200
committerLukas Slebodnik <lslebodn@redhat.com>2017-10-04 09:05:55 +0200
commit3e4fe6cc59419ce4c178e9ad31cd1069ab375e9b (patch)
tree11c23fe6c8ea40834740fb3c42d0be7ba80a4e28
parent7f68de6c2e6aaed1929dfbcf1a73606c9b79fd64 (diff)
downloadsssd-3e4fe6cc59419ce4c178e9ad31cd1069ab375e9b.tar.gz
sssd-3e4fe6cc59419ce4c178e9ad31cd1069ab375e9b.tar.xz
sssd-3e4fe6cc59419ce4c178e9ad31cd1069ab375e9b.zip
KCM: Use the right memory context
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 <fidencio@redhat.com>
-rw-r--r--src/responder/kcm/kcmsrv_ccache.c12
1 files 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,