summaryrefslogtreecommitdiffstats
path: root/src/libnetdata/json/json.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/libnetdata/json/json.h (renamed from libnetdata/json/json.h)9
1 files changed, 6 insertions, 3 deletions
diff --git a/libnetdata/json/json.h b/src/libnetdata/json/json.h
index b43f06b50..5c3459ede 100644
--- a/libnetdata/json/json.h
+++ b/src/libnetdata/json/json.h
@@ -1,7 +1,6 @@
#ifndef CHECKIN_JSON_H
#define CHECKIN_JSON_H 1
-
#if ENABLE_JSONC
#include <json-c/json.h>
// fix an older json-c bug
@@ -72,6 +71,10 @@ size_t json_walk_primitive(char *js, jsmntok_t *t, size_t start, JSON_ENTRY *e);
int json_callback_print(JSON_ENTRY *e);
+static inline void cleanup_json_object_pp(struct json_object **jobj) {
+ if(*jobj)
+ json_object_put(*jobj);
+}
+#define CLEAN_JSON_OBJECT _cleanup_(cleanup_json_object_pp) struct json_object
-
-#endif \ No newline at end of file
+#endif // CHECKIN_JSON_H