aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/json/json.c
diff options
context:
space:
mode:
authorGravatar Nicolas Noble <nnoble@google.com>2015-01-27 14:21:18 -0800
committerGravatar Nicolas "Pixel" Noble <pixel@nobis-crew.org>2015-01-28 01:11:24 +0100
commit8c2be9bbff075ea8090dcf1332a1d94e21126524 (patch)
treef9d1625c38be00612cbf332b0c449c1c17c3e04e /src/core/json/json.c
parenta2fa1d778f192902feab7b8c5b8f70a7290db051 (diff)
Addressing latest comments.
Diffstat (limited to 'src/core/json/json.c')
-rw-r--r--src/core/json/json.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/json/json.c b/src/core/json/json.c
index e7fcec31ff..1cff4fa195 100644
--- a/src/core/json/json.c
+++ b/src/core/json/json.c
@@ -31,23 +31,23 @@
*
*/
+#include <string.h>
+
#include <grpc/support/alloc.h>
#include "src/core/json/json.h"
-grpc_json *grpc_json_new(grpc_json_type type) {
+grpc_json *grpc_json_create(grpc_json_type type) {
grpc_json *json = gpr_malloc(sizeof(grpc_json));
- json->parent = json->child = json->next = json->prev = NULL;
+ memset(json, 0, sizeof(grpc_json));
json->type = type;
- json->value = json->key = NULL;
-
return json;
}
-void grpc_json_delete(grpc_json *json) {
+void grpc_json_destroy(grpc_json *json) {
while (json->child) {
- grpc_json_delete(json->child);
+ grpc_json_destroy(json->child);
}
if (json->next) {