Simple Directmedia Layer

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.

authored by

Mathieu Eyraud and committed by
Sam Lantinga
45bfa8e5 dcc3dd4c

+5 -1
+5 -1
src/video/x11/xsettings-client.c
··· 691 691 if (new_iter) 692 692 new_iter->next = new_node; 693 693 else 694 - new = new_node; 694 + { 695 + new = new_node; 696 + new->next = NULL; 697 + } 698 + 695 699 696 700 new_iter = new_node; 697 701