Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <jj@chaosbits.net>
Acked-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jesper Juhl and committed by
David S. Miller
155e4e12 be72f63b

+1
+1
net/batman-adv/translation-table.c
··· 197 197 del: 198 198 list_del(&entry->list); 199 199 kfree(entry); 200 + kfree(tt_change_node); 200 201 event_removed = true; 201 202 goto unlock; 202 203 }