mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 13:13:44 +01:00
Refactor the calloc semantic patch.
This does not change its effects.
This commit is contained in:
parent
3206dbdce1
commit
a746081f38
@ -1,15 +1,10 @@
|
||||
// Use calloc or realloc as appropriate instead of multiply-and-alloc
|
||||
|
||||
@malloc_to_calloc@
|
||||
expression a,b;
|
||||
@@
|
||||
- tor_malloc(a * b)
|
||||
+ tor_calloc(a, b)
|
||||
|
||||
@malloc_zero_to_calloc@
|
||||
identifier f =~ "(tor_malloc|tor_malloc_zero)";
|
||||
expression a, b;
|
||||
@@
|
||||
- tor_malloc_zero(a * b)
|
||||
- f(a * b)
|
||||
+ tor_calloc(a, b)
|
||||
|
||||
@realloc_to_reallocarray@
|
||||
|
Loading…
Reference in New Issue
Block a user