syntax-check: Prohibit the non-clearing 'g_new'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Peter Krempa
2025-10-08 09:24:42 +02:00
parent a74b5bc37f
commit 0756fefdc5
+1 -1
View File
@@ -92,7 +92,7 @@ sc_prohibit_raw_virclassnew:
# Avoid raw malloc and free, except in documentation comments.
sc_prohibit_raw_allocation:
@prohibit='^.[^*].*\<((m|c|re)alloc|free|g_malloc) *\([^)]' \
@prohibit='^.[^*].*\<((m|c|re)alloc|free|g_malloc|g_new) *\([^)]' \
halt='use g_new0/g_malloc0/g_free instead of malloc/free/g_malloc' \
$(_sc_search_regexp)