diff options
author | Emmanuele Bassi <ebassi@gmail.com> | 2021-10-09 15:45:34 +0000 |
---|---|---|
committer | tallua <talluay@gmail.com> | 2021-10-09 15:45:34 +0000 |
commit | f65506080874b28eda37b622242b172258d9df76 (patch) | |
tree | 225447119f403ce5a6b04860b8d11a39d4bc56c4 /json-glib/json-node.c | |
parent | ea90392f5f12e03a47c0bec60a755423b12d05bd (diff) | |
download | json-glib-f65506080874b28eda37b622242b172258d9df76.tar.gz |
Apply 2 suggestion(s) to 1 file(s)
Diffstat (limited to 'json-glib/json-node.c')
-rw-r--r-- | json-glib/json-node.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/json-glib/json-node.c b/json-glib/json-node.c index e5c631e..57221c1 100644 --- a/json-glib/json-node.c +++ b/json-glib/json-node.c @@ -147,15 +147,11 @@ json_node_unset (JsonNode *node) break; case JSON_NODE_ARRAY: - if (node->data.array) - json_array_unref (node->data.array); - node->data.array = NULL; + g_clear_pointer (&(node->data.array), json_array_unref); break; case JSON_NODE_VALUE: - if (node->data.value) - json_value_unref (node->data.value); - node->data.value = NULL; + g_clear_pointer (&(node->data.value), json_value_unref); break; case JSON_NODE_NULL: |