summaryrefslogtreecommitdiffstats
path: root/src/lib.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-04-14 11:11:24 +0200
committerDavid Robillard <d@drobilla.net>2019-04-14 11:18:00 +0200
commitac237a888cbd2ffe8446adc8a51482e603ca3765 (patch)
treed5521f5993fe668e446fac316fa447e12ee3d749 /src/lib.c
parent1a80c081cc2f3bf38f01512734c0001e4a1d295e (diff)
downloadlilv-ac237a888cbd2ffe8446adc8a51482e603ca3765.tar.gz
lilv-ac237a888cbd2ffe8446adc8a51482e603ca3765.tar.bz2
lilv-ac237a888cbd2ffe8446adc8a51482e603ca3765.zip
Fix Windows cross-library malloc/free errors
Diffstat (limited to 'src/lib.c')
-rw-r--r--src/lib.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib.c b/src/lib.c
index bd7233b..68eff47 100644
--- a/src/lib.c
+++ b/src/lib.c
@@ -40,7 +40,8 @@ lilv_lib_open(LilvWorld* world,
}
const char* const lib_uri = lilv_node_as_uri(uri);
- char* const lib_path = lilv_file_uri_parse(lib_uri, NULL);
+ char* const lib_path = (char*)serd_file_uri_parse(
+ (const uint8_t*)lib_uri, NULL);
if (!lib_path) {
return NULL;
}
@@ -49,7 +50,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());
- lilv_free(lib_path);
+ serd_free(lib_path);
return NULL;
}
@@ -65,17 +66,17 @@ lilv_lib_open(LilvWorld* world,
if (!desc) {
LILV_ERRORF("Call to %s:lv2_lib_descriptor failed\n", lib_path);
dlclose(lib);
- lilv_free(lib_path);
+ serd_free(lib_path);
return NULL;
}
} else if (!df) {
LILV_ERRORF("No `lv2_descriptor' or `lv2_lib_descriptor' in %s\n",
lib_path);
dlclose(lib);
- lilv_free(lib_path);
+ serd_free(lib_path);
return NULL;
}
- lilv_free(lib_path);
+ serd_free(lib_path);
LilvLib* llib = (LilvLib*)malloc(sizeof(LilvLib));
llib->world = world;