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
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c
index dcc30ca..6b061bc 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c
@@ -1415,7 +1415,7 @@
daemonize = 1;
break;
case 'c':
- config_file = strdup(optarg);
+ config_file = optarg;
break;
case 'T':
log_set_print_timestamp(osmo_stderr_target, 1);