diff options
author | 2016-05-07 22:11:37 -0700 | |
---|---|---|
committer | 2016-05-07 22:11:37 -0700 | |
commit | 965eab3aa2eb56cfa5df068390c71d513b1655e3 (patch) | |
tree | 0622f9e8675755890ff0de0a46378cb6b4386ffd /src/core/lib/iomgr/error.c | |
parent | 71d28ad3b50068a677254e01c514eb0f7290063c (diff) |
Fix refcounting
Diffstat (limited to 'src/core/lib/iomgr/error.c')
-rw-r--r-- | src/core/lib/iomgr/error.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/lib/iomgr/error.c b/src/core/lib/iomgr/error.c index d67eb6e425..6d16a54d57 100644 --- a/src/core/lib/iomgr/error.c +++ b/src/core/lib/iomgr/error.c @@ -240,8 +240,13 @@ grpc_error *grpc_error_set_int(grpc_error *src, grpc_error_ints which, return new; } -const intptr_t *grpc_error_get_int(grpc_error *err, grpc_error_ints which) { - return gpr_avl_get(err->ints, (void *)(uintptr_t)which); +bool grpc_error_get_int(grpc_error *err, grpc_error_ints which, intptr_t *p) { + void *pp; + if (gpr_avl_maybe_get(err->ints, (void *)(uintptr_t)which, &pp)) { + if (p != NULL) *p = (intptr_t)pp; + return true; + } + return false; } grpc_error *grpc_error_set_str(grpc_error *src, grpc_error_strs which, |