mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-19 18:00:33 +01:00
Add coccinelle script to remove pointless callocs
This commit is contained in:
parent
ef9a0d2048
commit
1bb10353ff
13
scripts/coccinelle/uncalloc.cocci
Normal file
13
scripts/coccinelle/uncalloc.cocci
Normal file
@ -0,0 +1,13 @@
|
||||
|
||||
@@
|
||||
expression a;
|
||||
@@
|
||||
- tor_calloc(1, a)
|
||||
+ tor_malloc_zero(a)
|
||||
|
||||
@@
|
||||
expression a;
|
||||
@@
|
||||
- tor_calloc(a, 1)
|
||||
+ tor_malloc_zero(a)
|
||||
|
Loading…
Reference in New Issue
Block a user