Repository : ssh://git@open-mesh.org/batman-adv
On branch : next
commit 45fdde36787aafe0a9720106eb5ad6b35f46988e Author: Jesper Juhl jj@chaosbits.net Date: Tue Aug 7 20:32:34 2012 +0200
batman-adv: Fix mem leak in the batadv_tt_local_event() function
Memory is allocated for 'tt_change_node' with kmalloc(). 'tt_change_node' may go out of scope without really being used for anything (except have a few members initialized) if we hit the 'del:' label. This patch makes sure we free the memory in that case.
Signed-off-by: Jesper Juhl jj@chaosbits.net Acked-by: Antonio Quartulli ordex@autistici.org
45fdde36787aafe0a9720106eb5ad6b35f46988e translation-table.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/translation-table.c b/translation-table.c index a438f4b..99dd8f7 100644 --- a/translation-table.c +++ b/translation-table.c @@ -197,6 +197,7 @@ static void batadv_tt_local_event(struct batadv_priv *bat_priv, del: list_del(&entry->list); kfree(entry); + kfree(tt_change_node); event_removed = true; goto unlock; }