summaryrefslogtreecommitdiffstats
path: root/server/responder/common/responder_dp.c
diff options
context:
space:
mode:
Diffstat (limited to 'server/responder/common/responder_dp.c')
-rw-r--r--server/responder/common/responder_dp.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/server/responder/common/responder_dp.c b/server/responder/common/responder_dp.c
index 076b15432..604c41945 100644
--- a/server/responder/common/responder_dp.c
+++ b/server/responder/common/responder_dp.c
@@ -190,11 +190,6 @@ int sss_dp_send_acct_req(struct resp_ctx *rctx, TALLOC_CTX *memctx,
return EINVAL;
}
- tmp_ctx = talloc_new(NULL);
- if (!tmp_ctx) {
- return ENOMEM;
- }
-
switch (type) {
case SSS_DP_USER:
be_type = BE_REQ_USER;
@@ -209,6 +204,20 @@ int sss_dp_send_acct_req(struct resp_ctx *rctx, TALLOC_CTX *memctx,
return EINVAL;
}
+ if (dp_requests == NULL) {
+ /* Create a hash table to handle queued update requests */
+ ret = hash_create(10, &dp_requests, NULL);
+ if (ret != HASH_SUCCESS) {
+ fprintf(stderr, "cannot create hash table (%s)\n", hash_error_string(ret));
+ return EIO;
+ }
+ }
+
+ tmp_ctx = talloc_new(NULL);
+ if (!tmp_ctx) {
+ return ENOMEM;
+ }
+
key.type = HASH_KEY_STRING;
key.str = NULL;