mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-22 14:23:04 +01:00
Add coccinelle script to remove pointless callocs
This commit is contained in:
parent
ef9a0d2048
commit
1bb10353ff
1 changed files with 13 additions and 0 deletions
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…
Add table
Reference in a new issue