...G...PS. [ZBX-8172] rewrote json_error() function to use zbx_dsprintf() and zbx_strdup(), other stylistic fixes