aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/analyzer/malloc-4.c
blob: 908bb28ee500c970738b14e5161c307f7b278439 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* { dg-additional-options "-Wno-incompatible-pointer-types" } */

#include <stdlib.h>

struct foo;
struct bar;
void *hv (struct foo **tm)
{
  void *p = __builtin_malloc (4);
  *tm = p;
  if (!p)
    abort ();
  return p;
}

void a5 (void)
{
  struct bar *qb = NULL;
  hv (&qb);
} /* { dg-warning "leak of 'qb'" } */