Browse files

jsonparser: Only prepend a prefix if there is one

In log_json_parser_process_single(), when parsing an object element,
only prepend a prefix if there is one, otherwise g_string_assign()
will complain on stderr with an assert, which is not something we'd

Signed-off-by: Gergely Nagy <>
  • Loading branch information...
1 parent 5752a72 commit 8016818ac2fa2328ccbeab6fa13a7dc876e4220b @algernon committed Aug 29, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 modules/json/jsonparser.c
3 modules/json/jsonparser.c
@@ -99,7 +99,8 @@ log_json_parser_process_single (struct json_object *jso,
json_object_get_string (jso));
case json_type_object:
- g_string_assign (sb_string (key), prefix);
+ if (prefix)
+ g_string_assign (sb_string (key), prefix);
g_string_append (sb_string (key), obj_key);
g_string_append_c (sb_string (key), '.');
log_json_parser_process_object (jso, sb_string (key)->str, msg);

0 comments on commit 8016818

Please sign in to comment.