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
check_overflow: store the size in bytes instead of bits.
[smatch.git]
/
validation
/
sm_memory.c
blob
a87068d15020267a6e2eb6267206c81f146a678d
1
struct
ture
{
2
int
*
a
;
3
};
4
5
struct
ture
*
a
;
6
struct
ture
*
b
;
7
void
func
(
void
)
8
{
9
struct
ture
*
aa
;
10
struct
ture
*
ab
;
11
struct
ture
*
ac
;
12
aa
=
kmalloc
();
13
ab
=
kmalloc
();
14
ac
=
kmalloc
();
15
16
a
=
aa
;
17
if
(
ab
) {
18
free
(
ab
);
19
return
;
20
}
21
free
(
ac
);
22
return
;
23
}
24
/*
25
* check-name: leak test #1
26
* check-command: smatch sm_memory.c
27
*
28
* check-output-start
29
sm_memory.c +19 func(12) error: memory leak of ac
30
* check-output-end
31
*/