diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index c2df68d1562..e44bdc64bc9 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2018-05-23 Pascal Obry + + * adaint.c (win32_wait): Properly free the handle/pid lists when + WaitForMultipleObjects fails (return WAIT_FAILED). + 2018-05-23 Pascal Obry * adaint.c (win32_wait): Add missing parentheses. diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index 07e55e4eb85..552bd4404c3 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -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; }