diff options
author | Muxi Yan <muxi@users.noreply.github.com> | 2017-01-22 20:28:49 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-22 20:28:49 +0800 |
commit | 9d97c165bc580d90a2dadc4053ef920c5279f94b (patch) | |
tree | 9a630e75d4597fb2be393a867981679dfad2a49a /src/core | |
parent | c84725fd02dc58a819c8c4e8acdc321e81f44764 (diff) | |
parent | 607413f62315363ecc2452bedb7e840cb4e3f2dc (diff) |
Merge pull request #9430 from muxi/fix-8842
Fix cronet header memory free
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/ext/transport/cronet/transport/cronet_transport.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.c b/src/core/ext/transport/cronet/transport/cronet_transport.c index 2683abf47c..02e5a4a3d2 100644 --- a/src/core/ext/transport/cronet/transport/cronet_transport.c +++ b/src/core/ext/transport/cronet/transport/cronet_transport.c @@ -655,8 +655,6 @@ static void convert_metadata_to_cronet_headers( headers[num_headers].key = key; headers[num_headers].value = value; num_headers++; - gpr_free(key); - gpr_free(value); if (curr == NULL) { break; } @@ -857,6 +855,12 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx, s->header_array.capacity = s->header_array.count; CRONET_LOG(GPR_DEBUG, "bidirectional_stream_start(%p, %s)", s->cbs, url); bidirectional_stream_start(s->cbs, url, 0, method, &s->header_array, false); + unsigned int header_index; + for (header_index = 0; header_index < s->header_array.count; + header_index++) { + gpr_free((void *)s->header_array.headers[header_index].key); + gpr_free((void *)s->header_array.headers[header_index].value); + } stream_state->state_op_done[OP_SEND_INITIAL_METADATA] = true; result = ACTION_TAKEN_WITH_CALLBACK; } else if (stream_op->recv_initial_metadata && |