diff options
author | Craig Tiller <ctiller@google.com> | 2017-02-24 15:28:24 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-24 15:28:24 -0800 |
commit | e1bc938b440f39cafafd327ecff034fa3dda7b1d (patch) | |
tree | f0aaf9531931ac5e329da60828eb3d71012afc52 /src | |
parent | f11e050e16daec41da0930263bae4d4c4a82363b (diff) | |
parent | 13792875de1046a2d31ed50d87fbfc8d9affce14 (diff) |
Merge pull request #9858 from ctiller/cb
Fix closure running: current code is unsafe
Diffstat (limited to 'src')
-rw-r--r-- | src/core/lib/channel/http_server_filter.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/core/lib/channel/http_server_filter.c b/src/core/lib/channel/http_server_filter.c index a6946ef9f3..ce519f9c92 100644 --- a/src/core/lib/channel/http_server_filter.c +++ b/src/core/lib/channel/http_server_filter.c @@ -252,12 +252,11 @@ static void hs_on_complete(grpc_exec_ctx *exec_ctx, void *user_data, *calld->pp_recv_message = calld->payload_bin_delivered ? NULL : (grpc_byte_stream *)&calld->read_stream; - calld->recv_message_ready->cb(exec_ctx, calld->recv_message_ready->cb_arg, - err); + grpc_closure_run(exec_ctx, calld->recv_message_ready, GRPC_ERROR_REF(err)); calld->recv_message_ready = NULL; calld->payload_bin_delivered = true; } - calld->on_complete->cb(exec_ctx, calld->on_complete->cb_arg, err); + grpc_closure_run(exec_ctx, calld->on_complete, GRPC_ERROR_REF(err)); } static void hs_recv_message_ready(grpc_exec_ctx *exec_ctx, void *user_data, @@ -268,8 +267,7 @@ static void hs_recv_message_ready(grpc_exec_ctx *exec_ctx, void *user_data, /* do nothing. This is probably a GET request, and payload will be returned in hs_on_complete callback. */ } else { - calld->recv_message_ready->cb(exec_ctx, calld->recv_message_ready->cb_arg, - err); + grpc_closure_run(exec_ctx, calld->recv_message_ready, GRPC_ERROR_REF(err)); } } |