On Friday 02 May 2014 01:35:13 Antonio Quartulli wrote:
From: Antonio Quartulli antonio@open-mesh.com
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: Antonio Quartulli antonio@open-mesh.com
Change since v1:
- properly release orig_node in case of gw_node allocation failure
gateway_client.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
Applied in revision 8dbdee5.
Thanks, Marek