From 73165aae95ffbb94c3adfb6aa368f78e62bfa725 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 5 Aug 2020 20:27:53 +0200 Subject: [PATCH] Fix XMLTree double-free XMLTree's d'tor frees all child element of the document root --- libs/ardour/plugin_manager.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libs/ardour/plugin_manager.cc b/libs/ardour/plugin_manager.cc index c6c3702f5f..da3d225f20 100644 --- a/libs/ardour/plugin_manager.cc +++ b/libs/ardour/plugin_manager.cc @@ -1592,12 +1592,11 @@ PluginManager::save_stats () XMLNode* root = new XMLNode (X_("PluginStats")); for (PluginStatsList::iterator i = statistics.begin(); i != statistics.end(); ++i) { - XMLNode* node = new XMLNode (X_("Plugin")); + XMLNode* node = root->add_child (X_("Plugin")); node->set_property (X_("type"), (*i).type); node->set_property (X_("id"), (*i).unique_id); node->set_property (X_("lru"), (*i).lru); node->set_property (X_("use-count"), (*i).use_count); - root->add_child_nocopy (*node); } XMLTree tree;