Commit cd742f4a by Pascal Obry Committed by Pierre-Marie de Rodat

[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
parent c2d2963d
2018-05-23 Pascal Obry <obry@adacore.com> 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. * adaint.c (win32_wait): Add missing parentheses.
2018-05-23 Hristian Kirtchev <kirtchev@adacore.com> 2018-05-23 Hristian Kirtchev <kirtchev@adacore.com>
......
...@@ -2607,6 +2607,8 @@ win32_wait (int *status) ...@@ -2607,6 +2607,8 @@ win32_wait (int *status)
/* If there was an error, exit now */ /* If there was an error, exit now */
if (res == WAIT_FAILED) if (res == WAIT_FAILED)
{ {
free (hl);
free (pidl);
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
......
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