kfreeaddr.cocci 552 B

1234567891011121314151617181920212223242526272829303132
  1. /// Free of a structure field
  2. ///
  3. // Confidence: High
  4. // Copyright: (C) 2013 Julia Lawall, INRIA/LIP6. GPLv2.
  5. // URL: http://coccinelle.lip6.fr/
  6. // Comments:
  7. // Options: --no-includes --include-headers
  8. virtual org
  9. virtual report
  10. virtual context
  11. @r depends on context || report || org @
  12. expression e;
  13. identifier f;
  14. position p;
  15. @@
  16. * kfree@p(&e->f)
  17. @script:python depends on org@
  18. p << r.p;
  19. @@
  20. cocci.print_main("kfree",p)
  21. @script:python depends on report@
  22. p << r.p;
  23. @@
  24. msg = "ERROR: kfree of structure field"
  25. coccilib.report.print_report(p[0],msg)