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
6113b1b9e3
commit
4c6b4b9ab6
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue