From 4cc5c82a87cf2316f425a9ea1de0fb29d0c24c8e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 23 Sep 2011 23:51:44 +0000 Subject: Fix memory leaks and errors. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3482 a436a847-0d15-0410-975c-d299462d15a1 --- src/client/PluginModel.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/client') diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp index 694e5ce0..80b78887 100644 --- a/src/client/PluginModel.cpp +++ b/src/client/PluginModel.cpp @@ -238,9 +238,11 @@ PluginModel::documentation() const LilvNodes* vals = lilv_plugin_get_value(_lilv_plugin, rdfs_comment); - const LilvNode* val = lilv_nodes_get_first(vals); - if (lilv_node_is_string(val)) { - doc += lilv_node_as_string(val); + if (vals) { + const LilvNode* val = lilv_nodes_get_first(vals); + if (lilv_node_is_string(val)) { + doc += lilv_node_as_string(val); + } } lilv_node_free(rdfs_comment); lilv_nodes_free(vals); @@ -266,9 +268,11 @@ PluginModel::port_documentation(uint32_t index) const LilvNodes* vals = lilv_port_get_value(_lilv_plugin, port, rdfs_comment); - const LilvNode* val = lilv_nodes_get_first(vals); - if (lilv_node_is_string(val)) { - doc += lilv_node_as_string(val); + if (vals) { + const LilvNode* val = lilv_nodes_get_first(vals); + if (lilv_node_is_string(val)) { + doc += lilv_node_as_string(val); + } } lilv_node_free(rdfs_comment); lilv_nodes_free(vals); -- cgit v1.2.1