Commit 923822a5 authored by Antonio Quartulli's avatar Antonio Quartulli Committed by popcornmix
Browse files

batman-adv: increase orig refcount when storing ref in gw_node



[ Upstream commit 377fe0f9 ]

A pointer to the orig_node representing a bat-gateway is
stored in the gw_node->orig_node member, but the refcount
for such orig_node is never increased.
This leads to memory faults when gw_node->orig_node is accessed
and the originator has already been freed.

Fix this by increasing the refcount on gw_node creation
and decreasing it on gw_node free.

Signed-off-by: default avatarAntonio Quartulli <antonio@open-mesh.com>
Signed-off-by: default avatarMarek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent ceba1bd3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment