From 6ebe7ca413588b39d97daee966ba191773aaac05 Mon Sep 17 00:00:00 2001 From: Nikos Tsipinakis Date: Sun, 6 May 2018 13:21:47 +0300 Subject: [PATCH] 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. --- src/x11/x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x11/x.c b/src/x11/x.c index 0f38487..b3df19c 100644 --- a/src/x11/x.c +++ b/src/x11/x.c @@ -330,7 +330,7 @@ static GdkPixbuf *get_pixbuf_from_file(const char *icon_path) GError *error = NULL; pixbuf = gdk_pixbuf_new_from_file(icon_path, &error); if (pixbuf == NULL) - g_free(error); + g_error_free(error); } return pixbuf; }