[B.A.T.M.A.N.] [PATCHv2 maint] batman-adv: increase orig refcount when storing ref in gw_node

Marek Lindner mareklindner at neomailbox.ch
Sun May 4 18:21:04 CEST 2014


On Friday 02 May 2014 01:35:13 Antonio Quartulli wrote:
> From: Antonio Quartulli <antonio at 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 at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.open-mesh.org/pipermail/b.a.t.m.a.n/attachments/20140505/0b4de75f/attachment.sig>


More information about the B.A.T.M.A.N mailing list