1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-23 21:45:30 +00:00

fix possible free(NULL)

This commit is contained in:
David 2016-03-13 17:09:58 +01:00
parent 098d84ef73
commit e43f3e95c0

View File

@ -84,12 +84,16 @@ static void _get_icons(void)
GString *name = g_string_new(g_dir_read_name(dir));
while (name->len) {
if (g_strcmp0("proIcon.png", name->str) == 0) {
g_string_free(icon_filename, true);
if (icon_filename) {
g_string_free(icon_filename, true);
}
icon_filename = g_string_new(icons_dir->str);
g_string_append(icon_filename, "/proIcon.png");
} else
if (g_strcmp0("proIconMsg.png", name->str) == 0){
g_string_free(icon_msg_filename, true);
if (icon_filename) {
g_string_free(icon_msg_filename, true);
}
icon_msg_filename = g_string_new(icons_dir->str);
g_string_append(icon_msg_filename, "/proIconMsg.png");
}