فهرست منبع

Fix xsettings list copy

If there is only 1 element in the list or memory allocation fails on the 2nd iteration then new->next is uninitialised.
Mathieu Eyraud 8 ماه پیش
والد
کامیت
45bfa8e5e7
1فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
  1. 5 1
      src/video/x11/xsettings-client.c

+ 5 - 1
src/video/x11/xsettings-client.c

@@ -691,7 +691,11 @@ xsettings_list_copy (XSettingsList *list)
       if (new_iter)
         new_iter->next = new_node;
       else
-        new = new_node;
+        {
+          new = new_node;
+          new->next = NULL;
+        }
+
 
       new_iter = new_node;