diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-01-07 01:36:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-07 01:36:59 +0100 |
commit | 46c323a66bee2899292885085ec7e7b51be095c3 (patch) | |
tree | 6f3d20049b091876659150b806d68d392d5d0394 /lib/routemap.c | |
parent | Merge pull request #24 from qlyoung/fix-uninitialized-jump (diff) | |
parent | bgpd, lib: fix a few scan-build catches (diff) | |
download | frr-46c323a66bee2899292885085ec7e7b51be095c3.tar.xz frr-46c323a66bee2899292885085ec7e7b51be095c3.zip |
Merge pull request #27 from qlyoung/fix-derefs2
bgpd, lib: fix a few scan-build catches
Diffstat (limited to 'lib/routemap.c')
-rw-r--r-- | lib/routemap.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/routemap.c b/lib/routemap.c index 487790bbf..74bae1fd7 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, |