(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
analyzer/
pr106539.c
       1  #include <stdlib.h>
       2  
       3  void *test (void)
       4  {
       5    void **p = (void **)malloc (sizeof (void *) * 2);
       6    if (!p)
       7      return NULL;
       8    p[0] = malloc(10);
       9    p[1] = malloc(20); /* { dg-message "allocated here" }  */
      10    void *q = realloc (p, sizeof (void *)); /* { dg-message "when 'realloc' succeeds, moving buffer" } */
      11    if (!q)
      12    /* { dg-warning "leak of '<unknown>'" "leak of unknown" { target *-*-* } .-1 } */
      13      return p;
      14    return q;
      15  }