diff options
author | David Robillard <d@drobilla.net> | 2015-01-29 22:49:40 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2015-01-29 22:49:40 +0000 |
commit | 48648e4330b224391307343198152cce4f446874 (patch) | |
tree | cd643b485161a7ea2bea5497a01788d06c0d2e8d /src/lib.c | |
parent | 4ff9f0b0b78681e4015feb1b2a54ec6f7becf563 (diff) | |
download | lilv-48648e4330b224391307343198152cce4f446874.tar.gz lilv-48648e4330b224391307343198152cce4f446874.tar.bz2 lilv-48648e4330b224391307343198152cce4f446874.zip |
Add lilv_file_uri_parse() for correct URI to path conversion.
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@5528 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/lib.c')
-rw-r--r-- | src/lib.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -33,7 +33,7 @@ lilv_lib_open(LilvWorld* world, } const char* const lib_uri = lilv_node_as_uri(uri); - const char* const lib_path = lilv_uri_to_path(lib_uri); + char* const lib_path = lilv_file_uri_parse(lib_uri, NULL); if (!lib_path) { return NULL; } @@ -42,6 +42,7 @@ lilv_lib_open(LilvWorld* world, void* lib = dlopen(lib_path, RTLD_NOW); if (!lib) { LILV_ERRORF("Failed to open library %s (%s)\n", lib_path, dlerror()); + free(lib_path); return NULL; } @@ -56,14 +57,17 @@ lilv_lib_open(LilvWorld* world, desc = ldf(bundle_path, features); if (!desc) { LILV_ERRORF("Call to `lv2_lib_descriptor' in %s failed\n", lib_path); + free(lib_path); return NULL; } } else if (!df) { LILV_ERRORF("No `lv2_descriptor' or `lv2_lib_descriptor' in %s\n", lib_path); dlclose(lib); + free(lib_path); return NULL; } + free(lib_path); LilvLib* llib = (LilvLib*)malloc(sizeof(LilvLib)); llib->world = world; |