From: Zachary Rasmor Date: Wed, 27 Apr 2016 04:51:54 +0000 (-0400) Subject: Remove free operation on thread name field. X-Git-Tag: suricata-3.1RC1~212 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbbca37a942f8122929cd2a4af1dd9ae425c9c56;p=thirdparty%2Fsuricata.git Remove free operation on thread name field. Name field is now a pre-allocated array - free is no longer necessary. Fix issue leading to segfault during interface shortening in Single runmode. --- diff --git a/src/tm-threads.c b/src/tm-threads.c index 4fbc54a2e2..b21770e4ea 100644 --- a/src/tm-threads.c +++ b/src/tm-threads.c @@ -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); } diff --git a/src/util-runmodes.c b/src/util-runmodes.c index 03ec2ba293..13724e98fe 100644 --- a/src/util-runmodes.c +++ b/src/util-runmodes.c @@ -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); }