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
type: introduce get_final_type()
[smatch.git]
/
validation
/
sm_memory.c
blob
145b1c0b494a2a55f75b174469f792930468550c
1
void
*
kmalloc
(
void
);
2
void
free
(
void
*);
3
4
struct
ture
{
5
int
*
a
;
6
};
7
8
struct
ture
*
a
;
9
struct
ture
*
b
;
10
void
func
(
void
)
11
{
12
struct
ture
*
aa
;
13
struct
ture
*
ab
;
14
struct
ture
*
ac
;
15
aa
=
kmalloc
();
16
ab
=
kmalloc
();
17
ac
=
kmalloc
();
18
19
a
=
aa
;
20
if
(
ab
) {
21
free
(
ab
);
22
return
;
23
}
24
free
(
ac
);
25
return
;
26
}
27
/*
28
* check-name: leak test #1
29
* check-command: smatch sm_memory.c
30
*
31
* check-output-start
32
sm_memory.c:22 func() warn: possible memory leak of 'ac'
33
sm_memory.c:22 func() error: memory leak of 'ac'
34
* check-output-end
35
*/