aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/json
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2018-07-18 08:54:35 -0700
committerGravatar ncteisen <ncteisen@gmail.com>2018-07-18 08:54:35 -0700
commit2c990387c72c085e646adfdecf277066f22e9b30 (patch)
treef5356b46eda34168ea234ab7632406fede422574 /src/core/lib/json
parentf87b9551c232fcc986ede271f496d3812c2b7b80 (diff)
reviewer feedback
Diffstat (limited to 'src/core/lib/json')
-rw-r--r--src/core/lib/json/json.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/lib/json/json.cc b/src/core/lib/json/json.cc
index 6d359573f8..e78b73cefd 100644
--- a/src/core/lib/json/json.cc
+++ b/src/core/lib/json/json.cc
@@ -58,6 +58,8 @@ void grpc_json_destroy(grpc_json* json) {
grpc_json* grpc_json_link_child(grpc_json* parent, grpc_json* child,
grpc_json* sibling) {
+ // link child up to parent
+ child->parent = parent;
// first child case.
if (parent->child == nullptr) {
GPR_ASSERT(sibling == nullptr);
@@ -81,7 +83,6 @@ grpc_json* grpc_json_create_child(grpc_json* sibling, grpc_json* parent,
grpc_json* child = grpc_json_create(type);
grpc_json_link_child(parent, child, sibling);
child->owns_value = owns_value;
- child->parent = parent;
child->value = value;
child->key = key;
return child;