From 45812c32adfb6aa43fd1448dce380faa6d744a98 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 23 Feb 2016 10:20:29 +0100 Subject: [PATCH] runmode: fix memleak on live modes setup (CID 1197760) --- src/util-runmodes.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util-runmodes.c b/src/util-runmodes.c index a327a5129f..110af4448f 100644 --- a/src/util-runmodes.c +++ b/src/util-runmodes.c @@ -419,10 +419,10 @@ int RunModeSetLiveCaptureWorkers(ConfigIfaceParserFunc ConfigParser, int ldev; for (ldev = 0; ldev < nlive; ldev++) { - char *live_dev_c = NULL; + const char *live_dev_c = NULL; if ((nlive <= 1) && (live_dev != NULL)) { aconf = ConfigParser(live_dev); - live_dev_c = SCStrdup(live_dev); + live_dev_c = live_dev; if (unlikely(live_dev_c == NULL)) { SCLogError(SC_ERR_MEM_ALLOC, "Can't allocate interface name"); exit(EXIT_FAILURE); @@ -461,7 +461,7 @@ int RunModeSetLiveCaptureSingle(ConfigIfaceParserFunc ConfigParser, if (live_dev != NULL) { aconf = ConfigParser(live_dev); } else { - char *live_dev_c = LiveGetDeviceName(0); + const char *live_dev_c = LiveGetDeviceName(0); aconf = ConfigParser(live_dev_c); /* \todo Set threads number in config to 1 */ }