aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/analyzer/pr94399.c
blob: 70270c37a27d517b0e8bb48bbfcdbcb466323372 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* { dg-skip-if "requires hosted libstdc++ for stdlib free" { ! hostedlib } } */

#include <stdlib.h>

#define _cleanup_(f) __attribute__((cleanup(f)))

static inline void freep(void **p) {
  free(*p);
}

void test(void) {
  _cleanup_(freep) void *ptr;

  ptr = malloc(3);
} /* { dg-bogus "leak" } */