]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix double free in new pool resource test [PR118681]
authorJonathan Wakely <jwakely@redhat.com>
Tue, 8 Jul 2025 23:54:33 +0000 (00:54 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 8 Jul 2025 23:56:48 +0000 (00:56 +0100)
This was supposed to free p1 and p2, not free p2 twice.

libstdc++-v3/ChangeLog:

PR libstdc++/118681
* testsuite/20_util/unsynchronized_pool_resource/118681.cc: Fix
deallocate argument.

libstdc++-v3/testsuite/20_util/unsynchronized_pool_resource/118681.cc

index 87e1b1d94043acd5f8a30fd4af068b5af12d56d5..9935f793cf915ac6cd33c1aa497a41cdad4c6344 100644 (file)
@@ -39,7 +39,7 @@ test_alignment(std::pmr::memory_resource& res, bool dealloc)
 
       if (dealloc)
       {
-       res.deallocate(p2, size, alignment);
+       res.deallocate(p1, size, alignment);
        res.deallocate(p2, size, alignment);
       }
     }