From: Eric Leblond Date: Fri, 4 Mar 2016 17:03:54 +0000 (+0100) Subject: runmodes: fix memleak X-Git-Tag: suricata-3.0.1RC1~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc942b4fb8bc9feaf8e7772674028147ebd17ea2;p=thirdparty%2Fsuricata.git runmodes: fix memleak active_runmode value was leaking in unix socket mode. --- diff --git a/src/runmodes.c b/src/runmodes.c index 998780d8b4..d9e06af785 100644 --- a/src/runmodes.c +++ b/src/runmodes.c @@ -360,6 +360,9 @@ void RunModeDispatch(int runmode, const char *custom_mode) } /* Export the custom mode */ + if (active_runmode) { + SCFree(active_runmode); + } active_runmode = SCStrdup(custom_mode); if (unlikely(active_runmode == NULL)) { SCLogError(SC_ERR_MEM_ALLOC, "Unable to dup active mode");