summaryrefslogtreecommitdiff
path: root/lib/routemap.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2020-02-19 15:03:12 -0500
committerGitHub <noreply@github.com>2020-02-19 15:03:12 -0500
commit49eddc738fb1c6431d310403eef5f37f3953b740 (patch)
treeca3d30086ac865e5ab79fe90be221c062cb5991d /lib/routemap.c
parent7088718b718e32039d70077f12939037d8590e9a (diff)
parent1c4eca648cb91d4aeb3dcbff6b11197285250389 (diff)
Merge pull request #5834 from opensourcerouting/route-map-fix-crash
lib: fix route-map coverity scan issue
Diffstat (limited to 'lib/routemap.c')
-rw-r--r--lib/routemap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/routemap.c b/lib/routemap.c
index 0d5621d90e..e214aa43b7 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -914,6 +914,7 @@ static struct route_map_index *route_map_index_new(void)
/* Free route map index. */
void route_map_index_delete(struct route_map_index *index, int notify)
{
+ struct routemap_hook_context *rhc;
struct route_map_rule *rule;
QOBJ_UNREG(index);
@@ -923,8 +924,8 @@ void route_map_index_delete(struct route_map_index *index, int notify)
index->map->name, index->pref);
/* Free route map northbound hook contexts. */
- while (!TAILQ_EMPTY(&index->rhclist))
- routemap_hook_context_free(TAILQ_FIRST(&index->rhclist));
+ while ((rhc = TAILQ_FIRST(&index->rhclist)) != NULL)
+ routemap_hook_context_free(rhc);
/* Free route match. */
while ((rule = index->match_list.head) != NULL)