aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Noah Eisen <ncteisen@google.com>2017-05-02 23:17:36 -0700
committerGravatar Noah Eisen <ncteisen@google.com>2017-05-02 23:26:05 -0700
commit89371914c906a760cb4ac00c2754f3c27549e7ee (patch)
tree345b78ae0b38b7dc7fb4aef9859c898ed49a7594
parent089449568c1297dcb07f354a196a35c83a91f2e6 (diff)
Fix error refcount bug
Added a missing ref in httpcli.c. Also added a test to avoid regression
-rw-r--r--src/core/lib/http/httpcli.c2
-rw-r--r--test/cpp/client/credentials_test.cc4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/core/lib/http/httpcli.c b/src/core/lib/http/httpcli.c
index 453a64b049..0ac2c2ad52 100644
--- a/src/core/lib/http/httpcli.c
+++ b/src/core/lib/http/httpcli.c
@@ -105,7 +105,7 @@ static void finish(grpc_exec_ctx *exec_ctx, internal_request *req,
grpc_error *error) {
grpc_polling_entity_del_from_pollset_set(exec_ctx, req->pollent,
req->context->pollset_set);
- grpc_closure_sched(exec_ctx, req->on_done, error);
+ grpc_closure_sched(exec_ctx, req->on_done, GRPC_ERROR_REF(error));
grpc_http_parser_destroy(&req->parser);
if (req->addresses != NULL) {
grpc_resolved_addresses_destroy(req->addresses);
diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc
index 418a54439a..23b3b2ef3f 100644
--- a/test/cpp/client/credentials_test.cc
+++ b/test/cpp/client/credentials_test.cc
@@ -50,6 +50,10 @@ TEST_F(CredentialsTest, InvalidGoogleRefreshToken) {
EXPECT_EQ(static_cast<CallCredentials*>(nullptr), bad1.get());
}
+TEST_F(CredentialsTest, DefaultCredentials) {
+ auto creds = GoogleDefaultCredentials();
+}
+
} // namespace testing
} // namespace grpc