]> skyeroc.xyz Git - dgamelaunch/commitdiff
userprefs - fix linked list dangling pointer in readprefs
authorTangles <andyrthomson@gmail.com>
Wed, 22 Jan 2020 14:39:00 +0000 (01:39 +1100)
committerTangles <andyrthomson@gmail.com>
Wed, 22 Jan 2020 14:39:00 +0000 (01:39 +1100)
dgamelaunch.c

index eea98acadcbe139291f404094e2b4cfee3e371de..7cfa4ea5f70a556cb07d5b2d64fbdd0eab4096b6 100644 (file)
@@ -2219,6 +2219,7 @@ readprefs ()
         *cpref = (struct userpref *)malloc(sizeof(struct userpref));
         (*cpref)->name = strdup(nameptr);
         (*cpref)->value = strdup(valptr);
+        (*cpref)->npref = NULL;
         cpref = &(*cpref)->npref;
         prefcount++;
     }