From: Donald Sharp Date: Thu, 22 Mar 2018 21:00:19 +0000 (-0400) Subject: zebra: When removing a rule, release from hash storing it. X-Git-Tag: frr-5.0-dev~122^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=d5c52f7605f3fab914425950bc36851e550fa044;p=matthieu%2Ffrr.git zebra: When removing a rule, release from hash storing it. When we are removing a rule from the zns->rules_hash, free up the rule from the hash and free the memory. Signed-off-by: Donald Sharp --- diff --git a/zebra/zebra_pbr.c b/zebra/zebra_pbr.c index a9bc8450ee..4b93168846 100644 --- a/zebra/zebra_pbr.c +++ b/zebra/zebra_pbr.c @@ -166,9 +166,10 @@ void zebra_pbr_del_rule(struct zebra_ns *zns, struct zebra_pbr_rule *rule) lookup = hash_lookup(zns->rules_hash, rule); kernel_del_pbr_rule(rule); - if (lookup) + if (lookup) { + hash_release(zns->rules_hash, lookup); XFREE(MTYPE_TMP, lookup); - else + } else zlog_warn("%s: Rule being deleted we know nothing about", __PRETTY_FUNCTION__); } @@ -182,6 +183,7 @@ static void zebra_pbr_cleanup_rules(struct hash_backet *b, void *data) if (rule->sock == *sock) { kernel_del_pbr_rule(rule); hash_release(zns->rules_hash, rule); + XFREE(MTYPE_TMP, rule); } }