From e1e9ad9a49da04500206c526e0f9b8711a811a12 Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Thu, 11 Apr 2024 17:34:14 +0800
Subject: [PATCH] fix(bg): not use list pointer after it has been deleted
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- 修复free后还错误的使用list指针的问题
---
 libmate-desktop/mate-bg.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libmate-desktop/mate-bg.c b/libmate-desktop/mate-bg.c
index bdc93ee..2958e33 100644
--- a/libmate-desktop/mate-bg.c
+++ b/libmate-desktop/mate-bg.c
@@ -2006,13 +2006,14 @@ static gboolean
 blow_expensive_caches (gpointer data)
 {
 	MateBG *bg = data;
-	GList *list;
+	GList *list,*next;
 
 	bg->blow_caches_id = 0;
 
 	if (bg->file_cache) {
-		for (list = bg->file_cache; list != NULL; list = list->next) {
+		for (list = bg->file_cache; list != NULL; list = next) {
 			FileCacheEntry *ent = list->data;
+			next = list->next;
 
 			if (ent->type == PIXBUF) {
 				file_cache_entry_delete (ent);
-- 
2.33.0

