Fix error refcount bug

Added a missing ref in httpcli.c. Also added a test to avoid
regression
pull/10972/head
Noah Eisen 8 years ago
parent 089449568c
commit 89371914c9
  1. 2
      src/core/lib/http/httpcli.c
  2. 4
      test/cpp/client/credentials_test.cc

@ -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);

@ -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

Loading…
Cancel
Save