From ac237a888cbd2ffe8446adc8a51482e603ca3765 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 14 Apr 2019 11:11:24 +0200 Subject: Fix Windows cross-library malloc/free errors --- src/state.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/state.c') diff --git a/src/state.c b/src/state.c index 2b6b113..3841c75 100644 --- a/src/state.c +++ b/src/state.c @@ -618,7 +618,7 @@ new_state_from_model(LilvWorld* world, sord_node_free(world->world, state_node); sord_node_free(world->world, statep); - free((void*)chunk.buf); + serd_free((void*)chunk.buf); sratom_free(sratom); if (state->props.props) { @@ -1153,7 +1153,10 @@ lilv_state_to_string(LilvWorld* world, serd_writer_free(writer); serd_env_free(env); - return (char*)serd_chunk_sink_finish(&chunk); + char* str = (char*)serd_chunk_sink_finish(&chunk); + char* result = lilv_strdup(str); + serd_free(str); + return result; } static void -- cgit v1.2.1