Invalid read segfault when closing after using the recent document popdown
The bug has been reported on https://bugs.launchpad.net/ubuntu/+source/gedit/+bug/1817459
Package: gedit 3.31.90-1build1
- open gedit
- click on the open popdown
- select a document
-> it segfaults on an invalid read that can be found in that valgring log https://bugs.launchpad.net/ubuntu/+source/gedit/+bug/1817459/+attachment/5241932/+files/valgrind.log
==2494== Invalid free() / delete / delete[] / realloc()
==2494== at 0x483897B: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==2494== by 0x4891CEF: gedit_open_document_selector_dispose (gedit-open-document-selector.c:753)
The bug was introduced in commit #aa8dbe82 and due to the fact that dispose is called a second time (it can happen according to https://developer.gnome.org/gobject/stable/howto-gobject-destruction.html), I'm going to mp a fix that just set the variable to NULL after freeing it.