From 02cde29b656451f64e715d5875d49683df9e9578 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 27 Feb 2026 22:21:42 +0100 Subject: [PATCH] cleanup: use g_new() instead of malloc in prof_add_shutdown_routine() --- src/profanity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/profanity.c b/src/profanity.c index 117be9a7..cd218e0a 100644 --- a/src/profanity.c +++ b/src/profanity.c @@ -292,7 +292,7 @@ prof_add_shutdown_routine(void (*routine)(void)) if (g_list_find_custom(shutdown_routines, &this, (GCompareFunc)_cmp_shutdown_routine)) { return; } - struct shutdown_routine* r = malloc(sizeof *r); + struct shutdown_routine* r = g_new(struct shutdown_routine, 1); r->routine = routine; shutdown_routines = g_list_prepend(shutdown_routines, r); }