From c41bbd3c33df25a25014e14fbeee4ced8f1433fa Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Tue, 19 Dec 2017 14:59:41 -0800 Subject: [PATCH] Fix wrong unreffing of slice --- src/core/lib/iomgr/tcp_client_posix.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/lib/iomgr/tcp_client_posix.cc b/src/core/lib/iomgr/tcp_client_posix.cc index 40ba1623a20..8cd5f8d6183 100644 --- a/src/core/lib/iomgr/tcp_client_posix.cc +++ b/src/core/lib/iomgr/tcp_client_posix.cc @@ -228,7 +228,8 @@ finish: gpr_free(error_descr); gpr_free(desc); error = grpc_error_set_str(error, GRPC_ERROR_STR_TARGET_ADDRESS, - addr_str_slice); + addr_str_slice /* takes ownership */); + } else { grpc_slice_unref(addr_str_slice); } if (done) {