[Ada] Fix memory leak in win32_wait error handling

2018-05-23  Pascal Obry  <obry@adacore.com>

gcc/ada/

	* adaint.c (win32_wait): Properly free the handle/pid lists when
	WaitForMultipleObjects fails (return WAIT_FAILED).

From-SVN: r260599
This commit is contained in:
Pascal Obry 2018-05-23 10:24:04 +00:00 committed by Pierre-Marie de Rodat
parent c2d2963d2c
commit cd742f4a16
2 changed files with 7 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2018-05-23 Pascal Obry <obry@adacore.com>
* adaint.c (win32_wait): Properly free the handle/pid lists when
WaitForMultipleObjects fails (return WAIT_FAILED).
2018-05-23 Pascal Obry <obry@adacore.com>
* adaint.c (win32_wait): Add missing parentheses.

View File

@ -2607,6 +2607,8 @@ win32_wait (int *status)
/* If there was an error, exit now */
if (res == WAIT_FAILED)
{
free (hl);
free (pidl);
errno = EINVAL;
return -1;
}