diff options
author | Craig Tiller <ctiller@google.com> | 2015-02-05 10:09:53 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-02-05 10:09:53 -0800 |
commit | 051a55c3b752aafbf2d3e20fb5471c4e2ef4b2db (patch) | |
tree | 621db29f5ac454bd2366a52534dd1360bce967ef /src/core | |
parent | 4e54cf5b99453b605758d2fd0ae3cd96078d73ee (diff) |
Don't double delete
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/surface/byte_buffer_queue.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/surface/byte_buffer_queue.c b/src/core/surface/byte_buffer_queue.c index 2adda8056c..9709a665ba 100644 --- a/src/core/surface/byte_buffer_queue.c +++ b/src/core/surface/byte_buffer_queue.c @@ -35,9 +35,9 @@ #include <grpc/support/alloc.h> #include <grpc/support/useful.h> -static void bba_destroy(grpc_bbq_array *array) { +static void bba_destroy(grpc_bbq_array *array, size_t start_pos) { size_t i; - for (i = 0; i < array->count; i++) { + for (i = start_pos; i < array->count; i++) { grpc_byte_buffer_destroy(array->data[i]); } gpr_free(array->data); @@ -53,8 +53,8 @@ static void bba_push(grpc_bbq_array *a, grpc_byte_buffer *buffer) { } void grpc_bbq_destroy(grpc_byte_buffer_queue *q) { - bba_destroy(&q->filling); - bba_destroy(&q->draining); + bba_destroy(&q->filling, 0); + bba_destroy(&q->draining, q->drain_pos); } int grpc_bbq_empty(grpc_byte_buffer_queue *q) { |