Prevent theoretical double free and leak on get_peer_sock_name.
authorRami Ylimäki <rami.ylimaki@vincit.fi>
Wed, 23 Mar 2011 15:47:50 +0000 (17:47 +0200)
committerPeter Harris <pharris@opentext.com>
Thu, 24 Mar 2011 15:30:21 +0000 (11:30 -0400)
commit70976d87f18d15c2ccc28eb7728e4822d3849e0d
tree1e8a654d536ce97f8acb60d1fe014ff7c55ba0e6
parent3678159e4ed64502f9ce218a63c8d069649f2215
Prevent theoretical double free and leak on get_peer_sock_name.

Variable new_sockname will leak and sockname will be double freed if
both of the cases shown below are true.

1. realloc succeeds and doesn't return the original pointer
2. calling socket_func fails

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Reviewed-by: Arnaud Fontaine <arnau@debian.org>
Signed-off-by: Peter Harris <pharris@opentext.com>
src/xcb_auth.c