links, var_sym: allocate fewer states
[smatch.git] / validation / sm_double_free2.c
blob6335a0b4cf751357c76c6af512feab209421ce66
1 #include <stdlib.h>
3 struct ture {
4 int a;
5 };
7 void func (void)
9 void *x;
11 x = malloc(sizeof(struct ture));
12 x->a = 1;
14 if (x->a)
15 free(x);
17 free(x);
19 return 0;
22 * check-name: double free test #2
23 * check-command: smatch sm_double_free2.c
25 * check-output-start
26 sm_double_free2.c:17 func() error: double free of 'x'
27 * check-output-end