]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
dns: fix leak in dns v1 logging
authorJason Ish <jason.ish@oisf.net>
Fri, 13 Nov 2020 19:05:48 +0000 (13:05 -0600)
committerJason Ish <jason.ish@oisf.net>
Fri, 13 Nov 2020 19:05:48 +0000 (13:05 -0600)
Intermediate JsonBuilder object was not being freed.

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/4086

src/output-json-dns.c

index f08d562cebcea90284d01118af23c30108025af6..1e922d9b638c8588c28c42d8d87822f6713afe53 100644 (file)
@@ -381,6 +381,7 @@ static int JsonDnsLoggerToClient(ThreadVars *tv, void *thread_data,
                 break;
             }
             jb_set_object(jb, "dns", answer);
+            jb_free(answer);
 
             MemBufferReset(td->buffer);
             OutputJsonBuilderBuffer(jb, td->file_ctx, &td->buffer);
@@ -401,6 +402,7 @@ static int JsonDnsLoggerToClient(ThreadVars *tv, void *thread_data,
                 break;
             }
             jb_set_object(jb, "dns", answer);
+            jb_free(answer);
 
             MemBufferReset(td->buffer);
             OutputJsonBuilderBuffer(jb, td->file_ctx, &td->buffer);