@@ -202,7 +202,7 @@
#endif
/* initialize options to default state */
- init_options(&c.options, true);
+ init_options(&c.options);
/* parse command line options, and read configuration file */
parse_argv(&c.options, argc, argv, M_USAGE, OPT_P_DEFAULT, NULL, c.es);
@@ -792,15 +792,12 @@
* will be set to 0.
*/
void
-init_options(struct options *o, const bool init_gc)
+init_options(struct options *o)
{
CLEAR(*o);
- if (init_gc)
- {
- gc_init(&o->gc);
- gc_init(&o->dns_options.gc);
- o->gc_owned = true;
- }
+ gc_init(&o->gc);
+ gc_init(&o->dns_options.gc);
+
o->mode = MODE_POINT_TO_POINT;
o->topology = TOP_UNDEF;
o->ce.proto = PROTO_UDP;
@@ -925,11 +922,9 @@
{
CLEAR(*o->remote_list);
}
- if (o->gc_owned)
- {
- gc_free(&o->gc);
- gc_free(&o->dns_options.gc);
- }
+
+ gc_free(&o->gc);
+ gc_free(&o->dns_options.gc);
}
#ifndef ENABLE_SMALL
@@ -2256,7 +2251,7 @@
int dev = DEV_TYPE_UNDEF;
bool pull = false;
- init_options(&defaults, true);
+ init_options(&defaults);
if (!options->test_crypto)
{
@@ -4824,7 +4819,7 @@
#else
struct options o;
- init_options(&o, true);
+ init_options(&o);
fprintf(fp, usage_message, title_string, o.ce.connect_retry_seconds,
o.ce.connect_retry_seconds_max, o.ce.local_port, o.ce.remote_port, TUN_MTU_DEFAULT,
@@ -5979,7 +5974,7 @@
struct options sub;
struct connection_entry *e;
- init_options(&sub, true);
+ init_options(&sub);
sub.ce = options->ce;
read_config_string("[CONNECTION-OPTIONS]", &sub, p[1], msglevel, OPT_P_CONNECTION,
option_types_found, es);
@@ -254,7 +254,6 @@
struct options
{
struct gc_arena gc;
- bool gc_owned;
/* first config file */
const char *config;
@@ -890,7 +889,7 @@
void show_dco_version(const unsigned int flags);
-void init_options(struct options *o, const bool init_gc);
+void init_options(struct options *o);
void uninit_options(struct options *o);
@@ -248,7 +248,6 @@
CLEAR(o); /* NB: avoiding init_options to limit dependencies */
gc_init(&o.gc);
gc_init(&o.dns_options.gc);
- o.gc_owned = true;
char *p_expect_someopt[MAX_PARMS];
char *p_expect_otheropt[MAX_PARMS];