Merge pull request #5834 from opensourcerouting/route-map-fix-crash

lib: fix route-map coverity scan issue
This commit is contained in:
Donald Sharp 2020-02-19 15:03:12 -05:00 committed by GitHub
commit 49eddc738f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)