aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/security/credentials.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/security/credentials.c')
-rw-r--r--src/core/security/credentials.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/core/security/credentials.c b/src/core/security/credentials.c
index e9229f0694..5e595899c3 100644
--- a/src/core/security/credentials.c
+++ b/src/core/security/credentials.c
@@ -831,11 +831,12 @@ static void fake_oauth2_get_request_metadata(grpc_credentials *creds,
grpc_fake_oauth2_credentials *c = (grpc_fake_oauth2_credentials *)creds;
if (c->is_async) {
- grpc_iomgr_add_callback(
- grpc_iomgr_cb_create(
- on_simulated_token_fetch_done,
- grpc_credentials_metadata_request_create(creds, cb, user_data),
- 0 /*GPR_FALSE*/));
+ grpc_iomgr_closure *on_simulated_token_fetch_done_closure =
+ gpr_malloc(sizeof(grpc_iomgr_closure));
+ grpc_iomgr_managed_closure_init(
+ on_simulated_token_fetch_done_closure, on_simulated_token_fetch_done,
+ grpc_credentials_metadata_request_create(creds, cb, user_data));
+ grpc_iomgr_add_callback(on_simulated_token_fetch_done_closure);
} else {
cb(user_data, c->access_token_md->entries, 1, GRPC_CREDENTIALS_OK);
}