From dbbca37a942f8122929cd2a4af1dd9ae425c9c56 Mon Sep 17 00:00:00 2001 From: Zachary Rasmor Date: Wed, 27 Apr 2016 00:51:54 -0400 Subject: [PATCH] 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. --- src/tm-threads.c | 3 --- src/util-runmodes.c | 6 ++++-- 2 files changed, 4 insertions(+), 5 deletions(-) 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); } -- 2.47.2