From 7730b13e5a18c94b25642e55e39992da7921306b Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Wed, 30 Apr 2014 09:08:21 +0200 Subject: [PATCH] Fix Address of stack memory associated with local variable 'flag' is still referred to by the global variable 'long_options' upon returning to the caller. This will be a dangling reference Found by Clang Analyzer --- src/h2load.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/h2load.cc b/src/h2load.cc index 7fb4ffd7..83ce1ca3 100644 --- a/src/h2load.cc +++ b/src/h2load.cc @@ -638,7 +638,7 @@ Options: int main(int argc, char **argv) { while(1) { - int flag = 0; + static int flag = 0; static option long_options[] = { {"requests", required_argument, nullptr, 'n'}, {"clients", required_argument, nullptr, 'c'},