summaryrefslogtreecommitdiffstats
path: root/src/syntax.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-04-27 21:21:27 +0000
committerDavid Robillard <d@drobilla.net>2011-04-27 21:21:27 +0000
commita57e86686e3143bd6e0873264a12a04cf7e9939d (patch)
treed3294898225e36512db4d4e75cab33ea80b7dc2c /src/syntax.c
parentdb07db58db6d83f008a4714a238a99f7f4855c9a (diff)
downloadsord-a57e86686e3143bd6e0873264a12a04cf7e9939d.tar.gz
sord-a57e86686e3143bd6e0873264a12a04cf7e9939d.tar.bz2
sord-a57e86686e3143bd6e0873264a12a04cf7e9939d.zip
Fix memory leaks.
git-svn-id: http://svn.drobilla.net/sord/trunk@88 3d64ff67-21c5-427c-a301-fe4f08042e5a
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 5d3653e..8a31a28 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -67,15 +67,20 @@ static inline SordNode
sord_node_from_serd_node(ReadState* state, const SerdNode* sn,
const SerdNode* datatype, const SerdNode* lang)
{
+ SordNode datatype_node = NULL;
+ SordNode ret = NULL;
switch (sn->type) {
case SERD_NOTHING:
return NULL;
case SERD_LITERAL:
- return sord_new_literal(
+ datatype_node = sord_node_from_serd_node(state, datatype, NULL, NULL),
+ ret = sord_new_literal(
state->world,
- sord_node_from_serd_node(state, datatype, NULL, NULL),
+ datatype_node,
sn->buf,
- g_intern_string((const char*)lang->buf));
+ sord_intern_lang(state->world, (const char*)lang->buf));
+ sord_node_free(state->world, datatype_node);
+ return ret;
case SERD_URI: {
SerdURI base_uri;
serd_read_state_get_base_uri(state->read_state, &base_uri);
@@ -165,7 +170,7 @@ event_statement(void* handle,
sord_node_free(state->world, tup[0]);
sord_node_free(state->world, tup[1]);
sord_node_free(state->world, tup[2]);
- // FIXME: sord_node_free(state->world, tup[3]);
+ sord_node_free(state->world, tup[3]);
return true;
}