Fixed a use after free when getting the cache path

This commit is contained in:
Scoopta 2019-09-12 11:06:57 -07:00
parent dbdb47c19a
commit 55da236d4e

View File

@ -156,7 +156,7 @@ static gboolean _insert_widget(gpointer data) {
static char* get_cache_path(char* mode) { static char* get_cache_path(char* mode) {
if(cache_file != NULL) { if(cache_file != NULL) {
return cache_file; return strdup(cache_file);
} }
char* cache_path = getenv("XDG_CACHE_HOME"); char* cache_path = getenv("XDG_CACHE_HOME");
if(cache_path == NULL) { if(cache_path == NULL) {