提交 155e4e12 编写于 作者: J Jesper Juhl 提交者: David S. Miller

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: NJesper Juhl <jj@chaosbits.net>
Acked-by: NAntonio Quartulli <ordex@autistici.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 be72f63b
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册