From e89012680e159a3cfd01bb56a25092c93cd6a17f Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Mon, 4 Dec 2017 12:16:21 -0300 Subject: [PATCH] highlight: Fix JSON structure --- src/modsecurity.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modsecurity.cc b/src/modsecurity.cc index 8861c39f..4282743c 100644 --- a/src/modsecurity.cc +++ b/src/modsecurity.cc @@ -406,9 +406,8 @@ int ModSecurity::processContentOffset(const char *content, size_t len, yajl_gen_map_close(g); - yajl_gen_array_close(g); - yajl_gen_map_close(g); + yajl_gen_array_close(g); yajl_gen_map_close(g); @@ -417,6 +416,7 @@ int ModSecurity::processContentOffset(const char *content, size_t len, json->assign(reinterpret_cast(buf), jsonSize); json->append("\n"); + yajl_gen_clear(g); yajl_gen_free(g); #else *err = strdup("Without YAJL support, we cannot generate JSON.");