1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-02 12:02:47 -05:00

Fix stale-pointer bugs in connection-fatal network errors.

I think these began to appear as a consequencce of replacing
fatalbox() calls with more sensible error reports: the more specific a
direction I send a report in, the greater the annoying possibility of
re-entrance when the resulting error handler starts closing stuff.
This commit is contained in:
Simon Tatham
2017-11-26 19:59:27 +00:00
parent 3e24bb610d
commit 57ceac8f1d
2 changed files with 5 additions and 1 deletions

View File

@ -1431,8 +1431,10 @@ static void net_select_result(int fd, int event)
while (err && s->addr && sk_nextaddr(s->addr, &s->step)) {
err = try_connect(s);
}
if (err)
if (err) {
plug_closing(s->plug, strerror(err), err, 0);
return; /* socket is now presumably defunct */
}
if (!s->connected)
return; /* another async attempt in progress */
}