Fix use-after-close in connect_network_socket
* src/process.c (connect_network_socket): Don’t use external_sock_fd after closing it. Problem found by Coverity Scan.
This commit is contained in:
parent
9eb028f886
commit
a066fb1cee
1 changed files with 4 additions and 0 deletions
|
@ -3185,6 +3185,8 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos,
|
|||
xerrno = errno;
|
||||
emacs_close (s);
|
||||
s = -1;
|
||||
if (socket_to_use < 0)
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -3312,6 +3314,8 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos,
|
|||
specpdl_ptr = specpdl + count1;
|
||||
emacs_close (s);
|
||||
s = -1;
|
||||
if (socket_to_use < 0)
|
||||
break;
|
||||
|
||||
#ifdef WINDOWSNT
|
||||
if (xerrno == EINTR)
|
||||
|
|
Loading…
Add table
Reference in a new issue