From f71de57a9097e50f5980bbdc8bfcb5f6361a1e7c Mon Sep 17 00:00:00 2001 From: Henri DF Date: Sun, 28 Feb 2016 20:26:42 -0800 Subject: [PATCH] fix unused vars warning in digwatch.cpp --- userspace/digwatch/digwatch.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/userspace/digwatch/digwatch.cpp b/userspace/digwatch/digwatch.cpp index ecfe810d..4e438cae 100644 --- a/userspace/digwatch/digwatch.cpp +++ b/userspace/digwatch/digwatch.cpp @@ -111,7 +111,7 @@ void do_inspect(sinsp* inspector, // int digwatch_init(int argc, char **argv) { - int result; + int result = EXIT_SUCCESS; sinsp* inspector = NULL; digwatch_rules* rules = NULL; digwatch_formats* formats = NULL; @@ -120,7 +120,7 @@ int digwatch_init(int argc, char **argv) int long_index = 0; string lua_main_filename; string lua_dir = DIGWATCH_INSTALLATION_DIR; - lua_State* ls; + lua_State* ls = NULL; static struct option long_options[] = { @@ -147,7 +147,6 @@ int digwatch_init(int argc, char **argv) { case 'h': usage(); - result = EXIT_SUCCESS; goto exit; case 'm': lua_main_filename = optarg; @@ -242,7 +241,10 @@ exit: delete inspector; } - lua_close(ls); + if(ls) + { + lua_close(ls); + } return result; }