| 1 |
#include <stdlib.h> |
| 2 |
|
| 3 |
struct s { |
| 4 |
char *p; |
| 5 |
int arr[2]; |
| 6 |
}; |
| 7 |
|
| 8 |
int main(void) { |
| 9 |
struct s *s = malloc(sizeof *s); |
| 10 |
if (s) { |
| 11 |
s->p = malloc(1); |
| 12 |
for (int i = 0; i < 2; i++) |
| 13 |
s->arr[i] = -1; /* { dg-bogus "leak" } */ |
| 14 |
} |
| 15 |
if (s) { |
| 16 |
free(s->p); |
| 17 |
free(s); |
| 18 |
} |
| 19 |
} |