summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-12-11 19:06:07 -0500
committerDavid Robillard <d@drobilla.net>2024-12-11 19:39:22 -0500
commit35354abb37202f99bec2d65e437dd7e2f8ffbc9d (patch)
tree52eacdf4d4d5c3185c8f71a5721050b9d65cab85 /src
parent9488ac7e5cc24b9d3a21b4a260ee74eaa86140ca (diff)
downloadlilv-35354abb37202f99bec2d65e437dd7e2f8ffbc9d.tar.gz
lilv-35354abb37202f99bec2d65e437dd7e2f8ffbc9d.tar.bz2
lilv-35354abb37202f99bec2d65e437dd7e2f8ffbc9d.zip
Fix potential memory leaks
Diffstat (limited to 'src')
-rw-r--r--src/port.c5
-rw-r--r--src/world.c1
2 files changed, 5 insertions, 1 deletions
diff --git a/src/port.c b/src/port.c
index 4ad5d70..a04298c 100644
--- a/src/port.c
+++ b/src/port.c
@@ -223,7 +223,7 @@ lilv_port_get_scale_points(const LilvPlugin* plugin, const LilvPort* port)
sord_new_uri(plugin->world->world, (const uint8_t*)LV2_CORE__scalePoint),
NULL);
- if (sord_iter_end(points)) {
+ if (!points) {
return NULL;
}
@@ -240,6 +240,9 @@ lilv_port_get_scale_points(const LilvPlugin* plugin, const LilvPort* port)
if (value && label) {
zix_tree_insert((ZixTree*)ret, lilv_scale_point_new(value, label), NULL);
+ } else {
+ lilv_node_free(label);
+ lilv_node_free(value);
}
}
sord_iter_free(points);
diff --git a/src/world.c b/src/world.c
index 42e644c..b299794 100644
--- a/src/world.c
+++ b/src/world.c
@@ -884,6 +884,7 @@ lilv_world_drop_graph(LilvWorld* world, const SordNode* graph)
while (!sord_iter_end(i)) {
const SerdStatus st = sord_erase(world->model, i);
if (st) {
+ sord_iter_free(i);
LILV_ERRORF("Error removing statement from <%s> (%s)\n",
sord_node_get_string(graph),
serd_strerror(st));