network: fix memleak in static prefix

Fixes #10608.
This commit is contained in:
Yu Watanabe 2018-11-01 21:46:36 +09:00
parent f19ee68140
commit 744faf5e4e

View file

@ -92,9 +92,11 @@ void prefix_free(Prefix *prefix) {
assert(prefix->network->n_static_prefixes > 0);
prefix->network->n_static_prefixes--;
if (prefix->section)
if (prefix->section) {
hashmap_remove(prefix->network->prefixes_by_section,
prefix->section);
network_config_section_free(prefix->section);
}
}
prefix->radv_prefix = sd_radv_prefix_unref(prefix->radv_prefix);