From: Andrew Bays Date: Wed, 28 Feb 2018 19:48:23 +0000 (-0500) Subject: Move misplaced yajl_gen_map_close X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=4613cd79224e68ecd6dc76aaa67f675115a7176d;p=collectd.git Move misplaced yajl_gen_map_close --- diff --git a/src/sysevent.c b/src/sysevent.c index 49efe75c..538618c6 100644 --- a/src/sysevent.c +++ b/src/sysevent.c @@ -344,9 +344,6 @@ static int gen_message_payload(const char *msg, char *sev, int sev_num, yajl_gen_status_ok) goto err; - if (yajl_gen_map_close(g) != yajl_gen_status_ok) - goto err; - // syslogMsg if (msg != NULL) { if (yajl_gen_string(g, (u_char *)SYSEVENT_SYSLOG_MSG_FIELD, @@ -389,6 +386,9 @@ static int gen_message_payload(const char *msg, char *sev, int sev_num, if (yajl_gen_string(g, (u_char *)SYSEVENT_SYSLOG_TAG_VALUE, strlen(SYSEVENT_SYSLOG_TAG_VALUE)) != yajl_gen_status_ok) goto err; + + if (yajl_gen_map_close(g) != yajl_gen_status_ok) + goto err; // *** END syslog fields ***