From cd9fe3a843e85259667b6b11f56c5f5c664c5948 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 30 Nov 2019 17:33:29 +0100 Subject: m_config: remove change callback before unintialization We don't want m_config uninitialization to call random change callbacks. This happens at the end of mp_destroy(), when almost everything else is already destroyed, and the change callbacks would probably trigger UB all over the place. The change callbacks could be trigger by m_config_restore_backups(), which is just used as a cheap way to free the remaining state. The worst is that this depends on which options may still have been part of this "backup" state, which depends on user input. Probably never a practical problem, since the backup state is most likely guaranteed to be empty before uninit is performed, but still. --- options/m_config.c | 1 + 1 file changed, 1 insertion(+) diff --git a/options/m_config.c b/options/m_config.c index a28ae4438b..68250c7e66 100644 --- a/options/m_config.c +++ b/options/m_config.c @@ -447,6 +447,7 @@ static struct m_config_shadow *m_config_shadow_new(const struct m_sub_options *r static void config_destroy(void *p) { struct m_config *config = p; + config->option_change_callback = NULL; m_config_restore_backups(config); talloc_free(config->cache); -- cgit v1.2.3