]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/analyzer: fix json output for warnings/notes
authorVictor Julien <victor@inliniac.net>
Fri, 5 Feb 2021 20:33:35 +0000 (21:33 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 9 Aug 2021 08:43:35 +0000 (10:43 +0200)
(cherry picked from commit 57f7612ffd6de650943607f2fb168015e45a39e1)

src/detect-engine-analyzer.c

index c44dc5cdfd73026719a6a9bfe5f73b487023b660..090f5a6f1aa962e5b848951af06d598fa5e9857b 100644 (file)
@@ -865,11 +865,13 @@ void EngineAnalysisRules2(const DetectEngineCtx *de_ctx, const Signature *s)
     jb_close(ctx.js);
 
     if (ctx.js_warnings) {
+        jb_close(ctx.js_warnings);
         jb_set_object(ctx.js, "warnings", ctx.js_warnings);
         jb_free(ctx.js_warnings);
         ctx.js_warnings = NULL;
     }
     if (ctx.js_notes) {
+        jb_close(ctx.js_notes);
         jb_set_object(ctx.js, "notes", ctx.js_notes);
         jb_free(ctx.js_notes);
         ctx.js_notes = NULL;