(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
analyzer/
pr98969.c
       1  struct foo
       2  {
       3    char *expr;
       4  };
       5  
       6  void
       7  test_1 (__UINTPTR_TYPE__ i)
       8  {
       9    struct foo *f = (struct foo *)i;
      10    f->expr = __builtin_malloc (1024);
      11  } /* { dg-bogus "leak" } */
      12  
      13  void
      14  test_2 (__UINTPTR_TYPE__ i)
      15  {
      16    __builtin_free (((struct foo *)i)->expr);
      17    __builtin_free (((struct foo *)i)->expr); /* { dg-warning "double-'free' of '\\*\\(\\(struct foo \\*\\)i\\)\\.expr'" } */
      18  }
      19  
      20  void
      21  test_3 (void *p)
      22  {
      23    void **q = (void **)p;
      24    *q = __builtin_malloc (1024);  
      25  }