From a1a70c7f2f2adbf5307124ad4300b90cd0f41a03 Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Mon, 20 Mar 2017 22:54:55 -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 f2daac02..ae721c9e 100644 --- a/src/modsecurity.cc +++ b/src/modsecurity.cc @@ -396,9 +396,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); @@ -406,6 +405,7 @@ int ModSecurity::processContentOffset(const char *content, size_t len, json->assign(reinterpret_cast(buf), jsonSize); + yajl_gen_clear(g); yajl_gen_free(g); #else *err = strdup("Without YAJL support, we cannot generate JSON.");