diff options
author | Craig Tiller <craig.tiller@gmail.com> | 2015-07-22 17:22:33 -0700 |
---|---|---|
committer | Craig Tiller <craig.tiller@gmail.com> | 2015-07-22 17:22:33 -0700 |
commit | 6c2d56b7efd8a00287bcd1ef5fbbdaf3fee0d567 (patch) | |
tree | 60f8acf2ab28ee5c6c7e11e15e67e55b79e5ea5f /src | |
parent | 6999c096d8fb683cbb78dd27be477d22d64c291f (diff) |
Addressing review comments
Diffstat (limited to 'src')
-rw-r--r-- | src/core/transport/metadata.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/transport/metadata.c b/src/core/transport/metadata.c index c5012baa24..967fd4898c 100644 --- a/src/core/transport/metadata.c +++ b/src/core/transport/metadata.c @@ -318,6 +318,7 @@ grpc_mdstr *grpc_mdstr_from_string(grpc_mdctx *ctx, const char *str, int canonic for (i = 0; str[i]; i++) { if (str[i] >= 'A' && str[i] <= 'Z') { canonical = 0; + /* Keep going in loop just to get string length */ } } len = i; @@ -325,7 +326,7 @@ grpc_mdstr *grpc_mdstr_from_string(grpc_mdctx *ctx, const char *str, int canonic if (canonical) { return grpc_mdstr_from_buffer(ctx, (const gpr_uint8 *)str, len); } else { - char *copy = gpr_malloc(len + 1); + char *copy = gpr_malloc(len); grpc_mdstr *ret; for (i = 0; i < len; i++) { if (str[i] >= 'A' && str[i] <= 'Z') { |