diff options
author | 2015-02-05 12:40:20 -0800 | |
---|---|---|
committer | 2015-02-05 12:40:20 -0800 | |
commit | 4f9727326e8ac36728d7a8f01e2a2f754273c864 (patch) | |
tree | f720a64192781aad2cde8dc4c4003c1a86c92bcc /src/core/surface/call.c | |
parent | 5e7a8ce90e9c94dfb0f8be2a08537b7623791103 (diff) |
Fix memory usage
Diffstat (limited to 'src/core/surface/call.c')
-rw-r--r-- | src/core/surface/call.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/surface/call.c b/src/core/surface/call.c index 1657edb3de..b47d5f4aec 100644 --- a/src/core/surface/call.c +++ b/src/core/surface/call.c @@ -908,8 +908,8 @@ void grpc_call_recv_metadata(grpc_call_element *elem, grpc_mdelem *md) { gpr_realloc(dest->metadata, sizeof(grpc_metadata) * dest->capacity); } mdusr = &dest->metadata[dest->count++]; - mdusr->key = (char *)grpc_mdstr_as_c_string(md->key); - mdusr->value = (char *)grpc_mdstr_as_c_string(md->value); + mdusr->key = grpc_mdstr_as_c_string(md->key); + mdusr->value = grpc_mdstr_as_c_string(md->value); mdusr->value_length = GPR_SLICE_LENGTH(md->value->slice); if (call->owned_metadata_count == call->owned_metadata_capacity) { call->owned_metadata_capacity = GPR_MAX( @@ -1089,8 +1089,8 @@ static void destroy_legacy_state(legacy_state *ls) { size_t i, j; for (i = 0; i < 2; i++) { for (j = 0; j < ls->md_out_count[i]; j++) { - gpr_free(ls->md_out[i][j].key); - gpr_free(ls->md_out[i][j].value); + gpr_free((char *)ls->md_out[i][j].key); + gpr_free((char *)ls->md_out[i][j].value); } gpr_free(ls->md_out[i]); } @@ -1123,7 +1123,7 @@ grpc_call_error grpc_call_add_metadata_old(grpc_call *call, mdout->key = gpr_strdup(metadata->key); mdout->value = gpr_malloc(metadata->value_length); mdout->value_length = metadata->value_length; - memcpy(mdout->value, metadata->value, metadata->value_length); + memcpy((char *)mdout->value, metadata->value, metadata->value_length); unlock(call); |