Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/jshn.c
diff options
context:
space:
mode:
Diffstat (limited to 'jshn.c')
-rw-r--r--jshn.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/jshn.c b/jshn.c
index 2eebe6c..9639951 100644
--- a/jshn.c
+++ b/jshn.c
@@ -178,12 +178,15 @@ static int jshn_parse(const char *str)
obj = json_tokener_parse(str);
if (!obj || json_object_get_type(obj) != json_type_object) {
+ if (obj)
+ json_object_put(obj);
fprintf(stderr, "Failed to parse message data\n");
return 1;
}
fprintf(stdout, "json_init;\n");
add_json_object(obj);
fflush(stdout);
+ json_object_put(obj);
return 0;
}