From: Eric Leblond Date: Wed, 28 Nov 2012 17:02:09 +0000 (+0100) Subject: unix runmode: fix error handling. X-Git-Tag: suricata-1.4rc1~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F231%2Fhead;p=thirdparty%2Fsuricata.git unix runmode: fix error handling. If 'output-dir' argument was not given it was possible to reach a possibly problematic condition. --- 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