From a833b4a0f4d03ddd3a736594442f4ae5200d9a15 Mon Sep 17 00:00:00 2001 From: Benedikt Heine Date: Wed, 30 Aug 2017 19:38:20 +0200 Subject: [PATCH] Fix memory leak in get_pixbuf_from_path If the svg-file is not found, the string containing the svg ending is never freed again. --- src/x11/x.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/x11/x.c b/src/x11/x.c index 7b14c1c..4e17942 100644 --- a/src/x11/x.c +++ b/src/x11/x.c @@ -341,6 +341,7 @@ static GdkPixbuf *get_pixbuf_from_path(char *icon_path) /* try svg */ maybe_icon_path = g_strconcat(current_folder, "/", icon_path, ".svg", NULL); if (!does_file_exist(maybe_icon_path)) { + g_free(maybe_icon_path); /* fallback to png */ maybe_icon_path = g_strconcat(current_folder, "/", icon_path, ".png", NULL); }