diff options
-rw-r--r-- | src/state.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/state.c b/src/state.c index 0ed5715..ddede30 100644 --- a/src/state.c +++ b/src/state.c @@ -781,15 +781,16 @@ lilv_state_new_from_file(LilvWorld* world, (subject) ? subject->node : sord_node_from_serd_node(world->world, env, &node, NULL, NULL); - const ZixStringView dirname = zix_path_parent_path(path); - char* const real_path = zix_canonical_path(NULL, dirname.data); - char* const dir_path = zix_path_join(NULL, real_path, NULL); + char* const dirname = zix_string_view_copy(NULL, zix_path_parent_path(path)); + char* const real_path = zix_canonical_path(NULL, dirname); + char* const dir_path = zix_path_join(NULL, real_path, NULL); LilvState* const state = new_state_from_model(world, map, model, subject_node, dir_path); zix_free(NULL, dir_path); zix_free(NULL, real_path); + zix_free(NULL, dirname); serd_node_free(&node); zix_free(NULL, abs_path); |