diff --git a/src/core/lib/iomgr/error.cc b/src/core/lib/iomgr/error.cc index 581b903f1a0..5fe6514802b 100644 --- a/src/core/lib/iomgr/error.cc +++ b/src/core/lib/iomgr/error.cc @@ -754,7 +754,7 @@ const char* grpc_error_string(grpc_error* err) { if (!gpr_atm_rel_cas(&err->atomics.error_string, 0, (gpr_atm)out)) { gpr_free(out); - out = (char*)gpr_atm_no_barrier_load(&err->atomics.error_string); + out = (char*)gpr_atm_acq_load(&err->atomics.error_string); } GPR_TIMER_END("grpc_error_string", 0); diff --git a/src/core/lib/transport/error_utils.cc b/src/core/lib/transport/error_utils.cc index acac1330b56..69c8ae6de36 100644 --- a/src/core/lib/transport/error_utils.cc +++ b/src/core/lib/transport/error_utils.cc @@ -71,10 +71,7 @@ void grpc_error_get_status(grpc_exec_ctx* exec_ctx, grpc_error* error, if (code != nullptr) *code = status; if (error_string != NULL && status != GRPC_STATUS_OK) { - const char* str = grpc_error_string(error); - if (str != nullptr) { - *error_string = gpr_strdup(str); - } + *error_string = gpr_strdup(grpc_error_string(error)); } if (http_error != nullptr) {