lib: Fix crash when deleting multiple statements

When deciding if we should delete a table we were
only looking at the part of the data structures
associated with the table to see if it was empty.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2016-03-01 16:44:23 -05:00
parent 53785cfdbf
commit 37b6ab6f00

View File

@ -512,7 +512,7 @@ trie_table_empty (struct pltrie_table *table)
{ {
size_t i; size_t i;
for (i = 0; i < PLC_LEN; i++) for (i = 0; i < PLC_LEN; i++)
if (table->entries[i].next_table || table->entries[i].final_chain) if (table->entries[i].next_table || table->entries[i].up_chain)
return 0; return 0;
return 1; return 1;
} }