The following commit has been merged in the batman-adv/next branch: commit 822d08d8b3e1d0fd546f69b9c00d0b88e844b90a 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 Signed-off-by: Antonio Quartulli ordex@autistici.org
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index 37ae4a9..112edd3 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@ -203,6 +203,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; }