From: Ben Pfaff Date: Fri, 21 Dec 2012 22:59:11 +0000 (-0800) Subject: classifier: Fix theoretical leak in classifier_destroy(). X-Git-Tag: sliver-openvswitch-1.9.90-3~10^2~20 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=0c09d44e6937e0eac39fd8b014a9bf0bd2412be8;p=sliver-openvswitch.git classifier: Fix theoretical leak in classifier_destroy(). The open-coded version of destroy_table() in classifier_destroy() didn't free the table's minimatch. Use destroy_table() to do it properly. This is only a theoretical leak because all the existing callers actually remove all the rules from their classifiers before they destroy them (outside of the tests/ directory, which I didn't examine) and so they don't ever have anything left to remove in classifier_destroy(). Signed-off-by: Ben Pfaff Acked-by: Ethan Jackson --- diff --git a/lib/classifier.c b/lib/classifier.c index e5d226ecb..d1fe524f4 100644 --- a/lib/classifier.c +++ b/lib/classifier.c @@ -146,9 +146,7 @@ classifier_destroy(struct classifier *cls) struct cls_table *table, *next_table; HMAP_FOR_EACH_SAFE (table, next_table, hmap_node, &cls->tables) { - hmap_destroy(&table->rules); - hmap_remove(&cls->tables, &table->hmap_node); - free(table); + destroy_table(cls, table); } hmap_destroy(&cls->tables); }