9
0
Fork 0

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:
Holger Hans Peter Freyther 2015-02-08 09:25:38 +01:00
parent 019851a523
commit 60e073e28d
1 changed files with 1 additions and 1 deletions

View File

@ -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);