diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 11:19:16 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 12:07:37 +0000 |
commit | b485aab7e71c1625cfc27e0f92c9509f42378458 (patch) | |
tree | ae9abe108601079d1679194de237c9a435ae5b55 /src/libnetdata/json/json.h | |
parent | Adding upstream version 1.44.3. (diff) | |
download | netdata-b485aab7e71c1625cfc27e0f92c9509f42378458.tar.xz netdata-b485aab7e71c1625cfc27e0f92c9509f42378458.zip |
Adding upstream version 1.45.3+dfsg.upstream/1.45.3+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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 |