summaryrefslogtreecommitdiff
path: root/lib/routemap.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/routemap.c')
-rw-r--r--lib/routemap.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/routemap.c b/lib/routemap.c
index 8331b76291..7749ea4cc7 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -963,6 +963,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);
@@ -2707,7 +2710,12 @@ static int route_map_dep_update(struct hash *dephash, const char *dep_name,
memset(&tmp_dep_data, 0, sizeof(struct route_map_dep_data));
tmp_dep_data.rname = rname;
dep_data = hash_lookup(dep->dep_rmap_hash, &tmp_dep_data);
- dep_data->refcnt--;
+
+ if (!dep_data)
+ goto out;
+
+ if (dep_data->refcnt)
+ dep_data->refcnt--;
if (!dep_data->refcnt) {
ret_dep_data = hash_release(dep->dep_rmap_hash,