summaryrefslogtreecommitdiff
path: root/lib/routemap.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/routemap.c')
-rw-r--r--lib/routemap.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/lib/routemap.c b/lib/routemap.c
index 5f2b2c0dfb..74bae1fd76 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -989,9 +989,11 @@ vty_show_route_map_entry (struct vty *vty, struct route_map *map)
/* Print the name of the protocol */
if (zlog_default)
+ {
vty_out (vty, "%s", zlog_proto_names[zlog_default->protocol]);
- if (zlog_default->instance)
- vty_out (vty, " %d", zlog_default->instance);
+ if (zlog_default->instance)
+ vty_out (vty, " %d", zlog_default->instance);
+ }
vty_out (vty, ":%s", VTY_NEWLINE);
for (index = map->head; index; index = index->next)
@@ -2766,17 +2768,16 @@ DEFUN (rmap_call,
struct route_map_index *index = VTY_GET_CONTEXT (route_map_index);
const char *rmap = argv[idx_word]->arg;
- if (index)
+ assert(index);
+
+ if (index->nextrm)
{
- if (index->nextrm)
- {
- route_map_upd8_dependency (RMAP_EVENT_CALL_DELETED,
- index->nextrm,
- index->map->name);
- XFREE (MTYPE_ROUTE_MAP_NAME, index->nextrm);
- }
- index->nextrm = XSTRDUP (MTYPE_ROUTE_MAP_NAME, rmap);
+ route_map_upd8_dependency (RMAP_EVENT_CALL_DELETED,
+ index->nextrm,
+ index->map->name);
+ XFREE (MTYPE_ROUTE_MAP_NAME, index->nextrm);
}
+ index->nextrm = XSTRDUP (MTYPE_ROUTE_MAP_NAME, rmap);
/* Execute event hook. */
route_map_upd8_dependency (RMAP_EVENT_CALL_ADDED,
@@ -2940,9 +2941,13 @@ route_map_finish (void)
}
for (i = 1; i < ROUTE_MAP_DEP_MAX; i++)
- hash_free(route_map_dep_hash[i]);
+ {
+ hash_free(route_map_dep_hash[i]);
+ route_map_dep_hash[i] = NULL;
+ }
hash_free (route_map_master_hash);
+ route_map_master_hash = NULL;
}
/* Initialization of route map vector. */