pidgin/pidgin

fix heap-use-after-free in prefs removal
use-after-free
15 months ago, Fabrice Bellet
0682910c702a
Parents e3d3676df758
Children da304c8c1cf9
fix heap-use-after-free in prefs removal
--- a/libpurple/prefs.c Wed Dec 18 22:41:28 2019 +0100
+++ b/libpurple/prefs.c Sun Nov 10 16:29:55 2019 +0100
@@ -789,12 +789,15 @@
}
child = pref->first_child;
+ pref->first_child = NULL;
while (child) {
struct purple_pref *next;
if (child->first_child) {
next = child->first_child;
+ child->first_child = NULL;
} else if (child->sibling) {
next = child->sibling;
+ child->sibling = NULL;
free_pref(child);
} else {
if (child->parent != pref) {