https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127569

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2026-11-21
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1

--- Comment #1 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Thanks for filing this bug report.

The analyzer is successfully tracking that there's an execution path in which
the return value is a freed pointer, but it never checks for that; it's merely
checking for pointers being "used" == dereferenced.

But such code is a clear "footgun" and we should complain about it.  The
obvious fix is to add a check for the return value of a function being a freed
pointer, and complain if we see that (probably as part of
-Wanalyzer-use-after-free).

I'll take a look at implementing this.

Reply via email to