Signed-off-by: Philippe Mathieu-Daudé <f4...@amsat.org> --- scripts/coccinelle/g_new.cocci | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/scripts/coccinelle/g_new.cocci b/scripts/coccinelle/g_new.cocci index c767325a21..368f0c5651 100644 --- a/scripts/coccinelle/g_new.cocci +++ b/scripts/coccinelle/g_new.cocci @@ -118,6 +118,15 @@ T *m; +m = g_try_new0(T, 1); ) +@@ +type T; +identifier m; +@@ +T **m; +... +- *m = g_malloc0(sizeof(**m)); ++ *m = g_new0(T *, 1); + //////////////////////////////////////// // // last transformations: cleanups -- 2.14.2