diff options
author | yang-g <yangg@google.com> | 2015-07-31 22:02:22 -0700 |
---|---|---|
committer | yang-g <yangg@google.com> | 2015-07-31 22:02:22 -0700 |
commit | 2f04c6e25849cc29e3427b37a2e3395c5d1f1a08 (patch) | |
tree | a66ba75e5d10c71f8007b7f1dede4763ece0b306 | |
parent | 61c8382fb00cf0d8e34e75a0e879703a58f59bab (diff) |
check before unref, this will fail in BadCreds test
-rw-r--r-- | src/core/surface/channel.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/surface/channel.c b/src/core/surface/channel.c index 81f673f856..688a586e18 100644 --- a/src/core/surface/channel.c +++ b/src/core/surface/channel.c @@ -229,7 +229,9 @@ static void destroy_channel(void *p, int ok) { registered_call *rc = channel->registered_calls; channel->registered_calls = rc->next; GRPC_MDELEM_UNREF(rc->path); - GRPC_MDELEM_UNREF(rc->authority); + if (rc->authority) { + GRPC_MDELEM_UNREF(rc->authority); + } gpr_free(rc); } grpc_mdctx_unref(channel->metadata_context); |