From 991c5480c46418e1dd0ff733e5f86de5e20429f5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Fri, 5 Feb 2016 10:40:27 +0100 Subject: [PATCH] utils-json: fix crash MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: Ie3f38f8c9c0449c3ea28eafec358bdc81ae40b32 Signed-off-by: José Bollo --- src/utils-json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.16.6