repo.or.cz
/
smatch.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
links, var_sym: allocate fewer states
[smatch.git]
/
validation
/
sm_double_free2.c
blob
6335a0b4cf751357c76c6af512feab209421ce66
1
#include <stdlib.h>
2
3
struct
ture
{
4
int
a
;
5
};
6
7
void
func
(
void
)
8
{
9
void
*
x
;
10
11
x
=
malloc
(
sizeof
(
struct
ture
));
12
x
->
a
=
1
;
13
14
if
(
x
->
a
)
15
free
(
x
);
16
17
free
(
x
);
18
19
return
0
;
20
}
21
/*
22
* check-name: double free test #2
23
* check-command: smatch sm_double_free2.c
24
*
25
* check-output-start
26
sm_double_free2.c:17 func() error: double free of 'x'
27
* check-output-end
28
*/