summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJesper Juhl <jj@chaosbits.net>2012-08-07 08:32:34 +0000
committerDavid S. Miller <davem@davemloft.net>2012-08-08 16:04:04 -0700
commit155e4e12b9f49c2dc817bb4c44e9416c46833c3d (patch)
treee52c4cda5536f6c9ca548a0b6b430723c67557ec /net
parentbe72f63b4cd5d6778cf7eb0d0a86f18f96b51c0c (diff)
downloadblackbird-op-linux-155e4e12b9f49c2dc817bb4c44e9416c46833c3d.tar.gz
blackbird-op-linux-155e4e12b9f49c2dc817bb4c44e9416c46833c3d.zip
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>
Diffstat (limited to 'net')
-rw-r--r--net/batman-adv/translation-table.c1
1 files changed, 1 insertions, 0 deletions
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;
}
OpenPOWER on IntegriCloud