*new* check_macros: find macro precedence bugs
[smatch.git] / validation / sm_redundant_check.c
blob1c0ae6449b6c2f2c37def4b2033daa1d98055bb2
1 void free(void *ptr);
2 void frob(void *ptr);
4 int x,y,z;
5 void func (void)
7 if (x)
8 free(x);
9 if (y)
10 frob(y);
11 free(y);
12 if (z) {
13 free(z);
19 * check-name: Redundant NULL check
20 * check-command: smatch sm_redundant_check.c
22 * check-output-start
23 sm_redundant_check.c +8 func(3) info: redundant null check on x calling free()
24 sm_redundant_check.c +13 func(8) info: redundant null check on z calling free()
25 * check-output-end