]> gcc.gnu.org Git - gcc.git/commitdiff
[Ada] Fix memory leak in win32_wait error handling
authorPascal Obry <obry@adacore.com>
Wed, 23 May 2018 10:24:04 +0000 (10:24 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 23 May 2018 10:24:04 +0000 (10:24 +0000)
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

gcc/ada/ChangeLog
gcc/ada/adaint.c

index c2df68d156276e6d315fe2e97906532910a8a607..e44bdc64bc9eb0064fc2daba9413a6f932034002 100644 (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.
index 07e55e4eb857b8e9e41fec7cc202155c71a99730..552bd4404c34b0896efc3327933f1f81865ad8df 100644 (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;
     }
This page took 0.071147 seconds and 5 git commands to generate.