refactor: replace malloc with g_new0 in many occasions
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user