https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66339
--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> --- This behaviour is by design and is not a bug. Valgrind no longer shows the allocation as reachable. Other tools might still show the memory as unfreed, but it's still not a bug.