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
user_data, db: improve how returned user data is handled
[smatch.git]
/
validation
/
sm_redundant_check.c
blob
569df631379b7f7cd16a9763634701363cf99958
1
void
free
(
void
*
ptr
);
2
void
frob
(
void
*
ptr
);
3
4
int
x
,
y
,
z
;
5
void
func
(
void
)
6
{
7
if
(
x
)
8
free
(
x
);
9
if
(
y
)
10
frob
(
y
);
11
free
(
y
);
12
if
(
z
) {
13
free
(
z
);
14
}
15
}
16
17
18
/*
19
* check-name: Redundant NULL check
20
* check-command: smatch sm_redundant_check.c
21
*
22
* check-output-start
23
sm_redundant_check.c:8 func() info: redundant null check on x calling free()
24
sm_redundant_check.c:13 func() info: redundant null check on z calling free()
25
* check-output-end
26
*/