diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugin.c | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/src/plugin.c b/src/plugin.c index cc1bdba..2f9e5b8 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -161,8 +161,10 @@ lilv_plugin_load(LilvPlugin* p) sord_add(p->world->model, quad); } + sord_iter_free(statements); lilv_node_free(prototype); } + sord_iter_free(prototypes); // Parse all the plugin's data files into RDF model LILV_FOREACH(nodes, i, p->data_uris) { @@ -833,6 +835,7 @@ lilv_plugin_get_project(const LilvPlugin* p) sord_node_free(p->world->world, lv2_project); if (sord_iter_end(projects)) { + sord_iter_free(projects); return NULL; } @@ -856,11 +859,12 @@ lilv_plugin_get_author(const LilvPlugin* p) doap_maintainer, NULL); - sord_node_free(p->world->world, doap_maintainer); - if (sord_iter_end(maintainers)) { + sord_iter_free(maintainers); + LilvNode* project = lilv_plugin_get_project(p); if (!project) { + sord_node_free(p->world->world, doap_maintainer); return NULL; } @@ -869,9 +873,14 @@ lilv_plugin_get_author(const LilvPlugin* p) project->node, doap_maintainer, NULL); + + lilv_node_free(project); } + sord_node_free(p->world->world, doap_maintainer); + if (sord_iter_end(maintainers)) { + sord_iter_free(maintainers); return NULL; } @@ -887,9 +896,11 @@ lilv_plugin_get_author_name(const LilvPlugin* plugin) { const SordNode* author = lilv_plugin_get_author(plugin); if (author) { - return lilv_plugin_get_one( - plugin, author, sord_new_uri( - plugin->world->world, NS_FOAF "name")); + SordWorld* sworld = plugin->world->world; + SordNode* foaf_name = sord_new_uri(sworld, NS_FOAF "name"); + LilvNode* ret = lilv_plugin_get_one(plugin, author, foaf_name); + sord_node_free(sworld, foaf_name); + return ret; } return NULL; } @@ -900,9 +911,11 @@ lilv_plugin_get_author_email(const LilvPlugin* plugin) { const SordNode* author = lilv_plugin_get_author(plugin); if (author) { - return lilv_plugin_get_one( - plugin, author, sord_new_uri( - plugin->world->world, NS_FOAF "mbox")); + SordWorld* sworld = plugin->world->world; + SordNode* foaf_mbox = sord_new_uri(sworld, NS_FOAF "mbox"); + LilvNode* ret = lilv_plugin_get_one(plugin, author, foaf_mbox); + sord_node_free(sworld, foaf_mbox); + return ret; } return NULL; } @@ -913,9 +926,11 @@ lilv_plugin_get_author_homepage(const LilvPlugin* plugin) { const SordNode* author = lilv_plugin_get_author(plugin); if (author) { - return lilv_plugin_get_one( - plugin, author, sord_new_uri( - plugin->world->world, NS_FOAF "homepage")); + SordWorld* sworld = plugin->world->world; + SordNode* foaf_homepage = sord_new_uri(sworld, NS_FOAF "homepage"); + LilvNode* ret = lilv_plugin_get_one(plugin, author, foaf_homepage); + sord_node_free(sworld, foaf_homepage); + return ret; } return NULL; } |