Skip to content

Commit

Permalink
batman-adv: Fix mem leak in the batadv_tt_local_event() function
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jesper Juhl authored and David S. Miller committed Aug 8, 2012
1 parent be72f63 commit 155e4e1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/batman-adv/translation-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 155e4e1

Please sign in to comment.