summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_routemap.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zebra_routemap.c')
-rw-r--r--zebra/zebra_routemap.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c
index 8ac08960a..ec8ee45cd 100644
--- a/zebra/zebra_routemap.c
+++ b/zebra/zebra_routemap.c
@@ -87,7 +87,7 @@ zebra_route_match_delete (struct vty *vty, struct route_map_index *index,
route_map_event_t type)
{
int ret;
- char *dep_name = (char *)arg;
+ char *dep_name = NULL;
const char *tmpstr;
char *rmap_name = NULL;
@@ -99,6 +99,10 @@ zebra_route_match_delete (struct vty *vty, struct route_map_index *index,
if ((tmpstr = route_map_get_match_arg(index, command)) != NULL)
dep_name = XSTRDUP(MTYPE_ROUTE_MAP_RULE, tmpstr);
}
+ else
+ {
+ dep_name = XSTRDUP(MTYPE_ROUTE_MAP_RULE, arg);
+ }
rmap_name = XSTRDUP(MTYPE_ROUTE_MAP_NAME, index->map->name);
}
@@ -119,7 +123,7 @@ zebra_route_match_delete (struct vty *vty, struct route_map_index *index,
if (type != RMAP_EVENT_MATCH_DELETED && dep_name)
route_map_upd8_dependency(type, dep_name, rmap_name);
- if (arg == NULL && dep_name)
+ if (dep_name)
XFREE(MTYPE_ROUTE_MAP_RULE, dep_name);
if (rmap_name)
XFREE(MTYPE_ROUTE_MAP_NAME, rmap_name);