From cc942b4fb8bc9feaf8e7772674028147ebd17ea2 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Fri, 4 Mar 2016 18:03:54 +0100 Subject: [PATCH] runmodes: fix memleak active_runmode value was leaking in unix socket mode. --- src/runmodes.c | 3 +++ 1 file changed, 3 insertions(+) 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");