From 55da236d4ec6ef9e4a4c31eaedc5b915893b10fc Mon Sep 17 00:00:00 2001 From: Scoopta Date: Thu, 12 Sep 2019 11:06:57 -0700 Subject: [PATCH] Fixed a use after free when getting the cache path --- src/wofi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wofi.c b/src/wofi.c index d2d0d76..169b498 100644 --- a/src/wofi.c +++ b/src/wofi.c @@ -156,7 +156,7 @@ static gboolean _insert_widget(gpointer data) { static char* get_cache_path(char* mode) { if(cache_file != NULL) { - return cache_file; + return strdup(cache_file); } char* cache_path = getenv("XDG_CACHE_HOME"); if(cache_path == NULL) {