This is the mail archive of the cygwin-cvs@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin] Cygwin: AF_UNIX: fix up thread parameter block allocation


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=99796906abc9d0be0249fbb33bfefc8573d77852

commit 99796906abc9d0be0249fbb33bfefc8573d77852
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Sun Mar 11 14:56:02 2018 +0100

    Cygwin: AF_UNIX: fix up thread parameter block allocation
    
    * don't abort on failing allocation, just return with error
    * make sure the allocation is restricted to a single process
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/fhandler_socket_unix.cc | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/winsup/cygwin/fhandler_socket_unix.cc b/winsup/cygwin/fhandler_socket_unix.cc
index ec5611a..2fc70f1 100644
--- a/winsup/cygwin/fhandler_socket_unix.cc
+++ b/winsup/cygwin/fhandler_socket_unix.cc
@@ -818,9 +818,10 @@ fhandler_socket_unix::wait_pipe (PUNICODE_STRING pipe_name)
   PVOID param;
 
   if (!(cwt_termination_evt = create_event ()))
-      return -1;
-  wait_info = (conn_wait_info_t *)
-	      cmalloc_abort (HEAP_FHANDLER, sizeof *wait_info);
+    return -1;
+  wait_info = (conn_wait_info_t *) cmalloc (HEAP_3_FHANDLER, sizeof *wait_info);
+  if (!wait_info)
+    return -1;
   wait_info->fh = this;
   RtlInitEmptyUnicodeString (&wait_info->pipe_name, wait_info->pipe_name_buf,
 			     sizeof wait_info->pipe_name_buf);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]