Fix crash when loading an invalid or corrupted icon

GError values should be freed with g_error_free rather than g_free it
otherwise causes a crash.

Credit to @bebehei for discovering this.
This commit is contained in:
Nikos Tsipinakis 2018-05-06 13:21:47 +03:00
parent b40118bbe3
commit 6ebe7ca413

View File

@ -330,7 +330,7 @@ static GdkPixbuf *get_pixbuf_from_file(const char *icon_path)
GError *error = NULL; GError *error = NULL;
pixbuf = gdk_pixbuf_new_from_file(icon_path, &error); pixbuf = gdk_pixbuf_new_from_file(icon_path, &error);
if (pixbuf == NULL) if (pixbuf == NULL)
g_free(error); g_error_free(error);
} }
return pixbuf; return pixbuf;
} }