]> git.proxmox.com Git - mirror_frr.git/blob - tools/coccinelle/xfreeaddr.cocci
Merge pull request #3920 from AkhileshSamineni/show_bgp_ipv6_summary_fix_master
[mirror_frr.git] / tools / coccinelle / xfreeaddr.cocci
1 /// Free of a structure field
2 ///
3 // Confidence: High
4 // Copyright: (C) 2013 Julia Lawall, INRIA/LIP6. GPLv2.
5 // Copyright: (C) 2019 Quentin Young. GPLv2.
6 // URL: http://coccinelle.lip6.fr/
7 // Comments:
8 // Options: --no-includes --include-headers
9
10 virtual org
11 virtual report
12 virtual context
13
14 @r depends on context || report || org @
15 expression e, t;
16 identifier f;
17 position p;
18 @@
19
20 * XFREE@p(t, &e->f)
21
22 @script:python depends on org@
23 p << r.p;
24 @@
25
26 cocci.print_main("XFREE",p)
27
28 @script:python depends on report@
29 p << r.p;
30 @@
31
32 msg = "ERROR: invalid free of structure field"
33 coccilib.report.print_report(p[0],msg)