lpm: fix missing free
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>
Mon, 21 Mar 2016 14:06:13 +0000 (15:06 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 22 Mar 2016 16:55:16 +0000 (17:55 +0100)
commitd4c18f0a1d5d03297a393b6bcda90e5acc27c710
tree561546f0854698822d2cde7faffe897acd46c184
parent42762a806256b3b0fa564d7eb8698b6e3a819c44
lpm: fix missing free

In rte_lpm_free lpm might not be freed if it didn't find a te (early return)

The two lpm interfaces rte_lpm_free_v20 and rte_lpm_free_v1604 had a leak.
rte_lpm_free_v20 might have missed to free rules_tbl
rte_lpm_free_v1604 due to an early exit might have missed to free
rules_tbl and lpm itself.

Fixes: 899d8bc9b3b5 ("lpm: make tailq fully local")

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
lib/librte_lpm/rte_lpm.c