aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/security/credentials_test.c
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-05-17 17:19:19 -0700
committerGravatar Craig Tiller <ctiller@google.com>2016-05-17 17:19:19 -0700
commit4727b9be84aa3607a76bd8eca4588e82a4ffbec5 (patch)
tree2850a596081a696561fa26db6a890895339a0dd5 /test/core/security/credentials_test.c
parente451225f7067ea2d71317aeb71bb9d4eb474921a (diff)
Cleanup error handling for google_default_credentials
Diffstat (limited to 'test/core/security/credentials_test.c')
-rw-r--r--test/core/security/credentials_test.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/core/security/credentials_test.c b/test/core/security/credentials_test.c
index eaa3563bec..f8e9720826 100644
--- a/test/core/security/credentials_test.c
+++ b/test/core/security/credentials_test.c
@@ -901,11 +901,11 @@ static int default_creds_gce_detection_httpcli_get_success_override(
gpr_timespec deadline, grpc_closure *on_done,
grpc_httpcli_response *response) {
*response = http_response(200, "");
- grpc_http_header header;
- header.key = "Metadata-Flavor";
- header.value = "Google";
+ grpc_http_header *headers = gpr_malloc(sizeof(*headers) * 1);
+ headers[0].key = "Metadata-Flavor";
+ headers[0].value = "Google";
response->hdr_count = 1;
- response->hdrs = &header;
+ response->hdrs = headers;
GPR_ASSERT(strcmp(request->http.path, "/") == 0);
GPR_ASSERT(strcmp(request->host, "metadata.google.internal") == 0);
grpc_exec_ctx_push(exec_ctx, on_done, GRPC_ERROR_NONE, NULL);