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