DEV: coccinelle: Add realloc_leak.cocci
This coccinelle patch finds locations where the return value of `realloc()` is assigned to the pointer passed to `realloc()`. This calls will leak memory if `realloc()` returns `NULL`.
This commit is contained in:
parent
e0c1d749a8
commit
e6c04507d8
|
@ -0,0 +1,6 @@
|
|||
@@
|
||||
expression E;
|
||||
expression F;
|
||||
@@
|
||||
|
||||
* E = realloc(E, F);
|
Loading…
Reference in New Issue