]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
aio: Fix freeing memory
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Tue, 11 Apr 2023 22:12:02 +0000 (00:12 +0200)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Tue, 11 Apr 2023 22:14:08 +0000 (00:14 +0200)
The content of the pool array is initialized only until pool_size,
pointers between pool_size and pool_max_size were not initialized by the
realloc call in get_elem so they should not be freed.

This fixes aio tests crashing at their termination on GNU/Hurd.

rt/aio_misc.c

index 49ec0aa293d8b36a16ecc951b71d3f98d5e254b1..4b850b1ab602a2ef9575c3313a979d88574024d6 100644 (file)
@@ -702,7 +702,7 @@ __aio_freemem (void)
 {
   size_t row;
 
-  for (row = 0; row < pool_max_size; ++row)
+  for (row = 0; row < pool_size; ++row)
     free (pool[row]);
 
   free (pool);