]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
The second argument to tor_calloc should be a constant.
authorMansour Moufid <mansourmoufid@gmail.com>
Sun, 19 Oct 2014 16:20:36 +0000 (12:20 -0400)
committerNick Mathewson <nickm@torproject.org>
Sun, 2 Nov 2014 16:54:42 +0000 (11:54 -0500)
Just like the conventional calloc.

scripts/coccinelle/calloc.cocci

index f7d7ec0dc3834ede45be2cc47edac8c2e8553fb2..df0b61de067e4960c5b8c5e5581591f62f431cce 100644 (file)
@@ -2,7 +2,8 @@
 
 @malloc_to_calloc@
 identifier f =~ "(tor_malloc|tor_malloc_zero)";
-expression a, b;
+expression a;
+constant b;
 @@
 - f(a * b)
 + tor_calloc(a, b)