diff options
author | Yash Tibrewal <yashkt@google.com> | 2018-01-18 15:19:04 -0800 |
---|---|---|
committer | Yash Tibrewal <yashkt@google.com> | 2018-01-18 15:19:04 -0800 |
commit | f0798f91ff0cc2cbb1424dd896a91972c47a8a7f (patch) | |
tree | 237d729c5ab9b027f6e4974c85151f3133c1c715 /test/core/client_channel | |
parent | 9a4c6b31e5165a03401b84b2601ac2b0c32ef5dc (diff) |
Solve a stack_use_after_scope issue in sockaddr_resolver_test
Diffstat (limited to 'test/core/client_channel')
-rw-r--r-- | test/core/client_channel/resolvers/sockaddr_resolver_test.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/core/client_channel/resolvers/sockaddr_resolver_test.cc b/test/core/client_channel/resolvers/sockaddr_resolver_test.cc index 4d16a77924..645749ffef 100644 --- a/test/core/client_channel/resolvers/sockaddr_resolver_test.cc +++ b/test/core/client_channel/resolvers/sockaddr_resolver_test.cc @@ -63,8 +63,10 @@ static void test_succeeds(grpc_resolver_factory* factory, const char* string) { grpc_resolver_next_locked(resolver, &on_res_arg.resolver_result, on_resolution); GRPC_RESOLVER_UNREF(resolver, "test_succeeds"); - grpc_uri_destroy(uri); + /* Flush ExecCtx to avoid stack-use-after-scope on on_res_arg which is + * accessed in the closure on_resolition_cb */ + grpc_core::ExecCtx::Get()->Flush(); } static void test_fails(grpc_resolver_factory* factory, const char* string) { |