From 8c8e3e1e306cb936be63cc033d8db2ca4442cbe5 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 2 Mar 2012 05:19:21 +0000 Subject: Fix memory leaks. git-svn-id: http://svn.drobilla.net/lad/trunk/sratom@4010 a436a847-0d15-0410-975c-d299462d15a1 --- src/sratom.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/sratom.c') diff --git a/src/sratom.c b/src/sratom.c index 4a15911..877f457 100644 --- a/src/sratom.c +++ b/src/sratom.c @@ -544,9 +544,8 @@ sratom_read_internal(Sratom* sratom, SordQuad match; SordQuad q2 = { node, 0, 0, 0 }; - for (SordIter* i = sord_find(model, q2); - !sord_iter_end(i); - sord_iter_next(i)) { + SordIter* i = sord_find(model, q2); + for (;!sord_iter_end(i); sord_iter_next(i)) { sord_iter_get(i, match); const SordNode* p = match[SORD_PREDICATE]; const char* p_uri = (const char*)sord_node_get_string(p); @@ -558,6 +557,7 @@ sratom_read_internal(Sratom* sratom, match[SORD_OBJECT], MODE_NORMAL); } } + sord_iter_free(i); } if (frame.ref) { lv2_atom_forge_pop(forge, &frame); @@ -638,6 +638,7 @@ sratom_from_turtle(Sratom* sratom, } else { fprintf(stderr, "Failed to find node\n"); } + sord_iter_free(i); } else { fprintf(stderr, "Failed to read Turtle\n"); } -- cgit v1.2.1