]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
output-json-alert: don't decref used object
authorEric Leblond <eric@regit.org>
Mon, 12 Jun 2017 12:04:38 +0000 (14:04 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 12 Jun 2017 17:21:52 +0000 (19:21 +0200)
In the unlikely case of a allocation error we will still use the
existing object so it should not be decref and freed.

src/output-json-alert.c

index 7526c96029ee1cb4fb7d18d72c22b18c36c9b97b..32f956dd7b95c484ffc0431257da40fb1aa1682b 100644 (file)
@@ -246,7 +246,6 @@ void AlertJsonHeader(const Packet *p, const PacketAlert *pa, json_t *js)
 
     json_t *ajs = json_object();
     if (ajs == NULL) {
-        json_decref(js);
         return;
     }