[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Add coccinelle script to remove pointless callocs



commit 1bb10353ff30626dae0540de7422e90b30bd68a6
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Tue Sep 16 11:11:17 2014 -0400

    Add coccinelle script to remove pointless callocs
---
 scripts/coccinelle/uncalloc.cocci |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/scripts/coccinelle/uncalloc.cocci b/scripts/coccinelle/uncalloc.cocci
new file mode 100644
index 0000000..bf3f741
--- /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)
+



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits