]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
runmode: fix memleak on live modes setup (CID 1197760)
authorVictor Julien <victor@inliniac.net>
Tue, 23 Feb 2016 09:20:29 +0000 (10:20 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 23 Feb 2016 09:20:29 +0000 (10:20 +0100)
src/util-runmodes.c

index a327a5129ff9f61c7c43ac5d82db228b8b303ace..110af4448f40cd5e3af8fa7d24c07c5dcb78c1b1 100644 (file)
@@ -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 */
     }