56543e1311
Add an spatch/coccinelle file to replace all free/malloc/realloc calls with g_free/g_malloc/g_realloc. It also removes all the error code paths that we do not need to check anymore.
29 lines
427 B
Text
29 lines
427 B
Text
@ free @
|
|
expression ptr;
|
|
@@
|
|
- free(ptr);
|
|
+ g_free(ptr);
|
|
@ malloc @
|
|
type ptr_type;
|
|
expression ptr;
|
|
expression size;
|
|
@@
|
|
- ptr = (ptr_type) malloc(size);
|
|
+ ptr = (ptr_type) g_malloc(size);
|
|
...
|
|
(
|
|
- if (ptr == (ptr_type) NULL) { ... }
|
|
|
|
|
)
|
|
@ realloc @
|
|
type ptr_type;
|
|
expression ptr;
|
|
expression size;
|
|
@@
|
|
- ptr = (ptr_type) realloc(ptr, size);
|
|
+ ptr = (ptr_type) g_realloc(ptr, size);
|
|
...
|
|
(
|
|
- if (ptr == (ptr_type) NULL) { ... }
|
|
|
|
|
)
|