]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Remove free operation on thread name field.
authorZachary Rasmor <zachary.r.rasmor@lmco.com>
Wed, 27 Apr 2016 04:51:54 +0000 (00:51 -0400)
committerVictor Julien <victor@inliniac.net>
Mon, 2 May 2016 08:10:40 +0000 (10:10 +0200)
Name field is now  a pre-allocated array - free is no longer necessary.
Fix issue leading to segfault during interface shortening in Single runmode.

src/tm-threads.c
src/util-runmodes.c

index 4fbc54a2e2bb48450dd718c72d0c261818de0330..b21770e4ea7c7cae3b80d2482b83a01af9e418c9 100644 (file)
@@ -1777,9 +1777,6 @@ void TmThreadFree(ThreadVars *tv)
 
     TmThreadDeinitMC(tv);
 
-    if (tv->name) {
-        SCFree(tv->name);
-    }
     if (tv->thread_group_name) {
         SCFree(tv->thread_group_name);
     }
index 03ec2ba29357892092e6148635b32e557f1efcdb..13724e98fe010b4e14a0640c6b8e44c46a8c133c 100644 (file)
@@ -442,6 +442,7 @@ int RunModeSetLiveCaptureSingle(ConfigIfaceParserFunc ConfigParser,
                               const char *live_dev)
 {
     int nlive = LiveGetDeviceCount();
+    const char *live_dev_c = NULL;
     void *aconf;
 
     if (nlive > 1) {
@@ -452,8 +453,9 @@ int RunModeSetLiveCaptureSingle(ConfigIfaceParserFunc ConfigParser,
 
     if (live_dev != NULL) {
         aconf = ConfigParser(live_dev);
+        live_dev_c = live_dev;
     } else {
-        const char *live_dev_c = LiveGetDeviceName(0);
+        live_dev_c = LiveGetDeviceName(0);
         aconf = ConfigParser(live_dev_c);
         /* \todo Set threads number in config to 1 */
     }
@@ -463,7 +465,7 @@ int RunModeSetLiveCaptureSingle(ConfigIfaceParserFunc ConfigParser,
                                  recv_mod_name,
                                  decode_mod_name,
                                  thread_name,
-                                 live_dev,
+                                 live_dev_c,
                                  aconf,
                                  1);
 }