summaryrefslogtreecommitdiffstats
path: root/tools/coccinelle/ifnullxfree.cocci
blob: 85fc23e394ab694a9e02b1c20d467d7f06acbdfe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/// NULL check before some freeing functions is not needed.
///
// Copyright: (C) 2014 Fabian Frederick.  GPLv2.
// Copyright: (C) 2019 Quentin Young.  GPLv2.
// Comments: -
// Options: --no-includes --include-headers

virtual patch

@r2 depends on patch@
expression E;
expression Y;
@@
- if (E != NULL)
XFREE(Y, E);