Fixed a use after free when getting the cache path
This commit is contained in:
parent
dbdb47c19a
commit
55da236d4e
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user