Commit 53917616 authored by Paul Eggert's avatar Paul Eggert
Browse files

Fix use-after-close in connect_network_socket

* src/process.c (connect_network_socket):
Reverse sense of previous fix.  Problem reported by Ken Brown in:
http://lists.gnu.org/archive/html/emacs-devel/2016-08/msg00004.html
parent 573dde70
......@@ -3185,7 +3185,7 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos,
xerrno = errno;
emacs_close (s);
s = -1;
if (socket_to_use < 0)
if (0 <= socket_to_use)
break;
continue;
}
......@@ -3314,7 +3314,7 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos,
specpdl_ptr = specpdl + count1;
emacs_close (s);
s = -1;
if (socket_to_use < 0)
if (0 <= socket_to_use)
break;
#ifdef WINDOWSNT
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment