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
This commit is contained in:
Alexis La Goutte 2014-04-30 09:08:21 +02:00 committed by Tatsuhiro Tsujikawa
parent ed5339953e
commit 7730b13e5a
1 changed files with 1 additions and 1 deletions

View File

@ -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'},