1  /* Reproducer for PR analyzer/97258: we should report the double-free
       2     inside a static callback if the callback escapes.  */
       3  
       4  #include <stdlib.h>
       5  
       6  static void callback_1 (void *p)
       7  {
       8    free (p);
       9    free (p); /* { dg-warning "double-'free' of 'p'" } */
      10  }
      11  
      12  struct ops {
      13    void (*cb) (void *);
      14  };
      15  
      16  static const struct ops ops_1 = {
      17    .cb = callback_1
      18  };
      19  
      20  extern void registration (const void *);
      21  
      22  void register_1 (void)
      23  {
      24    registration (&ops_1);
      25  }