]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
unix-manager: fix memleak at exit
authorEric Leblond <eric@regit.org>
Fri, 4 Mar 2016 17:36:00 +0000 (18:36 +0100)
committerEric Leblond <eric@regit.org>
Mon, 7 Mar 2016 22:12:07 +0000 (23:12 +0100)
Buffer allocated for UnixClient was not correctly freed.

src/unix-manager.c

index 19922cce7edb69ba312d089f5e1fce60b4bd7277..c2b87ad3d9eab01af2afb4ed824e0d0fbdd7fbd0 100644 (file)
@@ -580,6 +580,9 @@ int UnixMain(UnixCommand * this)
     }
 
     if (suricata_ctl_flags & (SURICATA_STOP | SURICATA_KILL)) {
+        TAILQ_FOREACH_SAFE(uclient, &this->clients, next, tclient) {
+            UnixCommandClose(this, uclient->fd);
+        }
         return 1;
     }