Skip to content

Commit 91f3b9c

Browse files
committed
Replace gmalloc and gmalloc0 with gmalloc0_n
1 parent 045fb6f commit 91f3b9c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/icon-lookup.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ int load_icon_theme_from_dir(const char *icon_dir, const char *subdir_theme) {
6464

6565
// load theme directories
6666
icon_themes[index].dirs_count = ini->section_count - 1;
67-
icon_themes[index].dirs = g_malloc0(icon_themes[index].dirs_count * sizeof(struct icon_theme_dir));
67+
icon_themes[index].dirs = g_malloc0_n(icon_themes[index].dirs_count, sizeof(struct icon_theme_dir));
6868

6969
for (int i = 0; i < icon_themes[index].dirs_count; i++) {
7070
struct section section = ini->sections[i+1];
@@ -126,13 +126,13 @@ int load_icon_theme_from_dir(const char *icon_dir, const char *subdir_theme) {
126126
if (icon_themes[index].inherits_count <= 0) {
127127
// set fallback theme to hicolor if there are no inherits
128128
g_strfreev(inherits);
129-
inherits = g_malloc(2 * sizeof(char*));
129+
inherits = g_malloc0_n(2, sizeof(char*));
130130
inherits[0] = g_strdup("hicolor");
131131
inherits[1] = NULL;
132132
icon_themes[index].inherits_count = 1;
133133
}
134134

135-
icon_themes[index].inherits_index = g_malloc0(icon_themes[index].inherits_count * sizeof(int));
135+
icon_themes[index].inherits_index = g_malloc0_n(icon_themes[index].inherits_count, sizeof(int));
136136

137137
for (int i = 0; inherits[i] != NULL; i++) {
138138
LOG_D("inherits: %s\n", inherits[i]);

0 commit comments

Comments
 (0)