diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/opendeco-cli.c | 8 | ||||
-rw-r--r-- | src/opendeco-conf.c | 8 |
2 files changed, 4 insertions, 12 deletions
diff --git a/src/opendeco-cli.c b/src/opendeco-cli.c index 579e013..e3fd852 100644 --- a/src/opendeco-cli.c +++ b/src/opendeco-cli.c @@ -79,9 +79,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) arguments->time = arg ? atof(arg) : -1; break; case 'g': - if (arguments->gas) - free(arguments->gas); - + free(arguments->gas); arguments->gas = strdup(arg); break; case 'p': @@ -100,9 +98,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) arguments->gfhigh = arg ? atoi(arg) : -1; break; case 'G': - if (arguments->decogasses) - free(arguments->decogasses); - + free(arguments->decogasses); arguments->decogasses = strdup(arg); break; case 'S': diff --git a/src/opendeco-conf.c b/src/opendeco-conf.c index d385bb0..e19440b 100644 --- a/src/opendeco-conf.c +++ b/src/opendeco-conf.c @@ -35,9 +35,7 @@ int opendeco_conf_parse(const char *confpath, struct arguments *arguments) toml_datum_t g = toml_string_in(dive, "gas"); if (g.ok) { - if (arguments->gas) - free(arguments->gas); - + free(arguments->gas); arguments->gas = g.u.s; } @@ -73,9 +71,7 @@ int opendeco_conf_parse(const char *confpath, struct arguments *arguments) toml_datum_t G = toml_string_in(deco, "decogasses"); if (G.ok) { - if (arguments->decogasses) - free(arguments->decogasses); - + free(arguments->decogasses); arguments->decogasses = G.u.s; } |