nat: getopt returns "static" data no need to copy it
I used strdup in case the data would not be valid from after the call to getopt and this creates a potential leak if a user is specifying multiple configuration files. If I depend on the fact that the string is a pointer into the argv[] array I can kill the strdup and fix the unlikely leak. Fixes: Coverity CID 1206578
This commit is contained in:
parent
019851a523
commit
60e073e28d
|
@ -1415,7 +1415,7 @@ static void handle_options(int argc, char **argv)
|
|||
daemonize = 1;
|
||||
break;
|
||||
case 'c':
|
||||
config_file = strdup(optarg);
|
||||
config_file = optarg;
|
||||
break;
|
||||
case 'T':
|
||||
log_set_print_timestamp(osmo_stderr_target, 1);
|
||||
|
|
Reference in New Issue