From 2accda78a10ed51dc9d645a08c316d0244f435eb Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Wed, 28 Nov 2012 18:02:09 +0100 Subject: [PATCH] unix runmode: fix error handling. If 'output-dir' argument was not given it was possible to reach a possibly problematic condition. --- src/runmode-unix-socket.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/runmode-unix-socket.c b/src/runmode-unix-socket.c index 7ab8717dd2..83259c908a 100644 --- a/src/runmode-unix-socket.c +++ b/src/runmode-unix-socket.c @@ -215,6 +215,10 @@ TmEcode UnixSocketAddPcapFile(json_t *cmd, json_t* answer, void *data) return TM_ECODE_FAILED; } output_dir = json_string_value(oarg); + } else { + SCLogInfo("error: can't get output-dir"); + json_object_set_new(answer, "message", json_string("output dir param is mandatory")); + return TM_ECODE_FAILED; } #ifdef OS_WIN32 -- 2.47.3