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

            Bug ID: 85055
           Summary: warn on accessing free memory
           Product: gcc
           Version: 7.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: matthew at wil dot cx
  Target Milestone: ---

GCC knows that a pointer passed to free() is no longer valid, but it misses an
opportunity to warn here:

char f(char *foo)
{
        free(foo);
        return foo[0];
}

Reply via email to