aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/surface
diff options
context:
space:
mode:
authorGravatar David Garcia Quintas <dgq@google.com>2015-08-12 11:24:24 -0700
committerGravatar David Garcia Quintas <dgq@google.com>2015-08-12 11:24:24 -0700
commit34396b595820cbbbbdbf338c9c8e5f0bc6001637 (patch)
treea47c27097b564096e5062e32760360f51b0cd2e8 /src/core/surface
parent616b375e3510a8572f6dbd22d4602bf3ca8c6245 (diff)
Added missing gpr_free for gpr_dump_slice char*
Diffstat (limited to 'src/core/surface')
-rw-r--r--src/core/surface/call.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/core/surface/call.c b/src/core/surface/call.c
index d825f2af69..fdd2286da0 100644
--- a/src/core/surface/call.c
+++ b/src/core/surface/call.c
@@ -551,17 +551,19 @@ static void set_encodings_accepted_by_peer(grpc_call *call,
/* Always support no compression */
GPR_BITSET(&call->encodings_accepted_by_peer, GRPC_COMPRESS_NONE);
for (i = 0; i < accept_encoding_parts.count; i++) {
- const gpr_slice* slice = &accept_encoding_parts.slices[i];
+ const gpr_slice *accept_encoding_entry_slice =
+ &accept_encoding_parts.slices[i];
if (grpc_compression_algorithm_parse(
- (const char *)GPR_SLICE_START_PTR(*slice), GPR_SLICE_LENGTH(*slice),
- &algorithm)) {
+ (const char *)GPR_SLICE_START_PTR(*accept_encoding_entry_slice),
+ GPR_SLICE_LENGTH(*accept_encoding_entry_slice), &algorithm)) {
GPR_BITSET(&call->encodings_accepted_by_peer, algorithm);
} else {
- /* TODO(dgq): it'd be nice to have a slice-to-cstr function to easily
- * print the offending entry */
+ char *accept_encoding_entry_str =
+ gpr_dump_slice(*accept_encoding_entry_slice, GPR_DUMP_ASCII);
gpr_log(GPR_ERROR,
"Invalid entry in accept encoding metadata: '%s'. Ignoring.",
- gpr_dump_slice(*slice, GPR_DUMP_ASCII));
+ accept_encoding_entry_str);
+ gpr_free(accept_encoding_entry_str);
}
}
}