refactor: replace malloc with g_new0 in many occasions

This commit is contained in:
Michael Vetter
2026-02-27 00:38:28 +01:00
parent de5949e8eb
commit 373ec4a7e3
19 changed files with 56 additions and 56 deletions

View File

@@ -418,7 +418,7 @@ _create_chatlog(const char* const other, const char* const login)
GDateTime* now = g_date_time_new_now_local();
auto_char char* filename = _get_log_filename(other, login, now, FALSE);
struct dated_chat_log* new_log = malloc(sizeof(struct dated_chat_log));
struct dated_chat_log* new_log = g_new0(struct dated_chat_log, 1);
new_log->filename = strdup(filename);
new_log->date = now;
@@ -431,7 +431,7 @@ _create_groupchat_log(const char* const room, const char* const login)
GDateTime* now = g_date_time_new_now_local();
auto_char char* filename = _get_log_filename(room, login, now, TRUE);
struct dated_chat_log* new_log = malloc(sizeof(struct dated_chat_log));
struct dated_chat_log* new_log = g_new0(struct dated_chat_log, 1);
new_log->filename = strdup(filename);
new_log->date = now;