Avoid possible invalid memory access when activating plugin
commit10f7cb24b26d1a62cdf4851788e4363efacb1b78
authorJiří Techet <techet@gmail.com>
Wed, 4 Nov 2015 11:50:57 +0000 (4 12:50 +0100)
committerJiří Techet <techet@gmail.com>
Wed, 4 Nov 2015 16:35:48 +0000 (4 17:35 +0100)
tree31c26f819e9e7360073407a2f54326f039a5f1fe
parent23323f53779ae54c8a9349bc4b1e0e48ac4acb5f
Avoid possible invalid memory access when activating plugin

It may happen (and happens on OS X) that plugin activation using
plugin_new() triggers some action which causes the tree view to
update. However, as the old plugin was freed before, the tree view
contains an invalid pointer to p which causes invalid memory access.

After freeing the old pointer, set the tree view value to NULL - the
plugin pointer is checked at other places for NULL value so it
doesn't crash.
src/plugins.c