diff options
author | Omar Polo <op@omarpolo.com> | 2021-06-12 10:19:17 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2021-06-12 10:19:17 +0000 |
commit | 3b33eab3ad8f82f967e201ab77e16ff28cb76e8e (patch) | |
tree | af97c3f300b28503ebecd5f3b6a230b28d286100 /gmid.c | |
parent | a6c809551e8dd554898a041a00d13b03a91d77cd (diff) |
TAILQ_REMOVE env and aliases during config_free
it's not technically required, since a couple of lines below we free
whole host struct, and we don't have code that may use
h->{env,aliases} afterwards, but it's nice not to have invalid
pointers around. it may bite in the future.
Diffstat (limited to 'gmid.c')
-rw-r--r-- | gmid.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -281,12 +281,16 @@ free_config(void) } TAILQ_FOREACH_SAFE(e, &h->env, envs, te) { + TAILQ_REMOVE(&h->env, e, envs); + free(e->name); free(e->value); free(e); } TAILQ_FOREACH_SAFE(a, &h->aliases, aliases, ta) { + TAILQ_REMOVE(&h->aliases, a, aliases); + free(a->alias); free(a); } |