]> asedeno.scripts.mit.edu Git - PuTTY_svn.git/commit
Control of 'addr' is now handed over to {platform_,}new_connection() and
authorJacob Nevins <jacobn@chiark.greenend.org.uk>
Thu, 7 Aug 2003 16:04:33 +0000 (16:04 +0000)
committerJacob Nevins <jacobn@chiark.greenend.org.uk>
Thu, 7 Aug 2003 16:04:33 +0000 (16:04 +0000)
commit9053764b5a65d7c5dbf06c0a41795923a98c4fd5
tree0cb00e7a69a40214af9e197a9351f7c7fe2a62a4
parentcef6fab6cb469ef7f341dbb8ccf630483deac841
Control of 'addr' is now handed over to {platform_,}new_connection() and
sk_new() on invocation; these functions become responsible for (eventually)
freeing it. The caller must not do anything with 'addr' after it's been passed
in. (Ick.)

Why:
A SOCKS5 crash appears to have been caused by overzealous freeing of
a SockAddr (ssh.c:1.257 [r2492]), which for proxied connections is
squirreled away long-term (and this can't easily be avoided).

It would have been nice to make a copy of the SockAddr, in case the caller has
a use for it, but one of the implementations (uxnet.c) hides a "struct
addrinfo" in there, and we have no defined way to duplicate those. (None of the
current callers _do_ have a further use for the SockAddr.)

As far as I can tell, everything _except_ proxying only needs addr for the
duration of the call, so sk_addr_free()s immediately. If I'm mistaken, it
should at least be easier to find the offending free()...

git-svn-id: http://svn.tartarus.org/sgt/putty@3383 cda61777-01e9-0310-a592-d414129be87e
13 files changed:
mac/mtcpnet.c
mac/otnet.c
network.h
portfwd.c
proxy.c
raw.c
rlogin.c
ssh.c
telnet.c
unix/uxnet.c
unix/uxproxy.c
winnet.c
x11fwd.c