diff options
-rw-r--r-- | src/utils-json.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/utils-json.c b/src/utils-json.c index b3bee36..82908f4 100644 --- a/src/utils-json.c +++ b/src/utils-json.c @@ -83,7 +83,7 @@ int j_add(struct json_object *obj, const char *key, struct json_object *val) int j_add_string(struct json_object *obj, const char *key, const char *val) { - struct json_object *str = json_object_new_string (val); + struct json_object *str = json_object_new_string (val ? val : ""); return str ? j_add(obj, key, str) : (errno = ENOMEM, 0); } |