]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
unix runmode: fix JSON mem handling
authorEric Leblond <eric@regit.org>
Tue, 20 Nov 2012 09:15:13 +0000 (10:15 +0100)
committerEric Leblond <eric@regit.org>
Tue, 20 Nov 2012 10:02:46 +0000 (11:02 +0100)
json_decref was not correctly used through the code. This patch
fixes it.

src/runmode-unix-socket.c

index 79888ecc88877f9d8e6612eb011d74f6cca22bcf..763cafe2bef845adc045539af5f8d4130d7273f0 100644 (file)
@@ -91,6 +91,7 @@ static TmEcode UnixSocketPcapFilesList(json_t *cmd, json_t* answer, void *data)
     }
     jarray = json_array();
     if (jarray == NULL) {
+        json_decref(jdata);
         json_object_set_new(answer, "message",
                             json_string("internal error at json object creation"));
         return TM_ECODE_FAILED;