diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-09-16 11:11:17 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-09-16 11:11:17 -0400 |
commit | 1bb10353ff30626dae0540de7422e90b30bd68a6 (patch) | |
tree | cc1572e0d24425e972b4404eb8ab397675210db0 | |
parent | ef9a0d204838768055194bd47acdb0074c2f13cb (diff) | |
download | tor-1bb10353ff30626dae0540de7422e90b30bd68a6.tar.gz tor-1bb10353ff30626dae0540de7422e90b30bd68a6.zip |
Add coccinelle script to remove pointless callocs
-rw-r--r-- | scripts/coccinelle/uncalloc.cocci | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/coccinelle/uncalloc.cocci b/scripts/coccinelle/uncalloc.cocci new file mode 100644 index 0000000000..bf3f74165a --- /dev/null +++ b/scripts/coccinelle/uncalloc.cocci @@ -0,0 +1,13 @@ + +@@ +expression a; +@@ +- tor_calloc(1, a) ++ tor_malloc_zero(a) + +@@ +expression a; +@@ +- tor_calloc(a, 1) ++ tor_malloc_zero(a) + |