lib: fix route map description memory leak

Route map entries are not getting a chance to call `description` string
deallocation on shutdown or when the parent entry is destroyed, so lets
add a code to handle this in the `route_map_index_delete` function.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
Rafael Zalamena 2020-07-06 11:39:27 -03:00
parent 4267c07425
commit f095133583

View File

@ -971,6 +971,9 @@ void route_map_index_delete(struct route_map_index *index, int notify)
zlog_debug("Deleting route-map %s sequence %d",
index->map->name, index->pref);
/* Free route map entry description. */
XFREE(MTYPE_TMP, index->description);
/* Free route map northbound hook contexts. */
while ((rhc = TAILQ_FIRST(&index->rhclist)) != NULL)
routemap_hook_context_free(rhc);