mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-30 14:26:22 +00:00
cleanup: use g_new() instead of malloc in prof_add_shutdown_routine()
This commit is contained in:
@@ -292,7 +292,7 @@ prof_add_shutdown_routine(void (*routine)(void))
|
|||||||
if (g_list_find_custom(shutdown_routines, &this, (GCompareFunc)_cmp_shutdown_routine)) {
|
if (g_list_find_custom(shutdown_routines, &this, (GCompareFunc)_cmp_shutdown_routine)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
struct shutdown_routine* r = malloc(sizeof *r);
|
struct shutdown_routine* r = g_new(struct shutdown_routine, 1);
|
||||||
r->routine = routine;
|
r->routine = routine;
|
||||||
shutdown_routines = g_list_prepend(shutdown_routines, r);
|
shutdown_routines = g_list_prepend(shutdown_routines, r);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user