From 09fd7060ec32d2930196d18778b56a0c66edf60c Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Fri, 20 Jun 2014 18:11:29 +0200 Subject: [PATCH] unix socket: fix valgrind issue This patch fixes the following issue reported by valgrind: 31 errors in context 1 of 1: Conditional jump or move depends on uninitialised value(s) at 0x8AB2F8: UnixSocketPcapFilesCheck (runmode-unix-socket.c:279) by 0x97725D: UnixCommandBackgroundTasks (unix-manager.c:368) by 0x97BC52: UnixManagerThread (unix-manager.c:884) by 0x6155F6D: start_thread (pthread_create.c:311) by 0x6E3A9CC: clone (clone.S:113) The running field in PcapCommand was not initialized. --- src/runmode-unix-socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/runmode-unix-socket.c b/src/runmode-unix-socket.c index 8a3d017f43..03d7790315 100644 --- a/src/runmode-unix-socket.c +++ b/src/runmode-unix-socket.c @@ -382,6 +382,7 @@ int RunModeUnixSocketSingle(DetectEngineCtx *de_ctx) } pcapcmd->de_ctx = de_ctx; TAILQ_INIT(&pcapcmd->files); + pcapcmd->running = 0; pcapcmd->currentfile = NULL; UnixManagerThreadSpawn(de_ctx, 1);