* select.cc (start_thread_socket): Delete si on early return in case of

an error (CID 59967).
This commit is contained in:
Corinna Vinschen 2014-06-23 14:56:45 +00:00
parent 565e3643dd
commit f739fd3ef0
2 changed files with 17 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2014-06-23 Corinna Vinschen <corinna@vinschen.de>
* select.cc (start_thread_socket): Delete si on early return in case of
an error (CID 59967).
2014-06-23 Corinna Vinschen <corinna@vinschen.de>
* regex/regcomp.c (computematchjumps): Free local memory in case of

View File

@ -1414,7 +1414,10 @@ start_thread_socket (select_record *me, select_stuff *stuff)
si = new select_socket_info;
if (!init_tls_select_info ())
return 0;
{
delete si;
return 0;
}
si->ser_num = _my_tls.locals.select.ser_num;
si->w4 = _my_tls.locals.select.w4;
@ -1440,14 +1443,20 @@ start_thread_socket (select_record *me, select_stuff *stuff)
+ MAXIMUM_WAIT_OBJECTS)
* sizeof (LONG));
if (!nser)
return 0;
{
delete si;
return 0;
}
_my_tls.locals.select.ser_num = si->ser_num = nser;
HANDLE *nw4 = (HANDLE *) realloc (si->w4,
(_my_tls.locals.select.max_w4
+ MAXIMUM_WAIT_OBJECTS)
* sizeof (HANDLE));
if (!nw4)
return 0;
{
delete si;
return 0;
}
_my_tls.locals.select.w4 = si->w4 = nw4;
_my_tls.locals.select.max_w4 += MAXIMUM_WAIT_OBJECTS;
}