From: Jesper Juhl Date: Tue, 7 Aug 2012 08:32:34 +0000 (+0000) Subject: batman-adv: Fix mem leak in the batadv_tt_local_event() function X-Git-Tag: next-20120816~106^2~20 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=155e4e12b9f49c2dc817bb4c44e9416c46833c3d;p=karo-tx-linux.git 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 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 Acked-by: Antonio Quartulli Signed-off-by: David S. Miller --- diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index a438f4b582fc..99dd8f75b3ff 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/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; }