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

@@ -97,7 +97,7 @@ status_bar_init(void)
{
tz = g_time_zone_new_local();
statusbar = malloc(sizeof(StatusBar));
statusbar = g_new0(StatusBar, 1);
statusbar->time = NULL;
statusbar->prompt = NULL;
statusbar->fulljid = NULL;
@@ -190,7 +190,7 @@ _create_tab(const int win, win_type_t wintype, char* identifier, gboolean highli
{
int true_win = win == 0 ? 10 : win;
StatusBarTab* tab = malloc(sizeof(StatusBarTab));
StatusBarTab* tab = g_new0(StatusBarTab, 1);
tab->identifier = strdup(identifier);
tab->highlight = highlight;
tab->window_type = wintype;