diff options
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | src/instance.c | 2 | ||||
-rw-r--r-- | src/util.c | 6 | ||||
-rw-r--r-- | utils/lv2bench.c | 4 |
4 files changed, 11 insertions, 4 deletions
@@ -1,10 +1,11 @@ lilv (0.20.1) unstable; * Tolerate passing NULL to lilv_state_restore() + * Fix a few minor/unlikely memory errors * Configure based on compiler target OS for cross-compilation * Minor documentation improvements - -- David Robillard <d@drobilla.net> Sat, 04 Oct 2014 23:27:33 -0400 + -- David Robillard <d@drobilla.net> Mon, 17 Nov 2014 01:43:02 -0500 lilv (0.20.0) stable; diff --git a/src/instance.c b/src/instance.c index 88a94fb..a3e2c91 100644 --- a/src/instance.c +++ b/src/instance.c @@ -51,7 +51,7 @@ lilv_plugin_instantiate(const LilvPlugin* plugin, const LV2_Feature** local_features = NULL; if (features == NULL) { - local_features = (const LV2_Feature**)malloc(sizeof(LV2_Feature)); + local_features = (const LV2_Feature**)malloc(sizeof(LV2_Feature*)); local_features[0] = NULL; } @@ -68,13 +68,15 @@ lilv_strjoin(const char* first, ...) if (s == NULL) break; - const size_t this_len = strlen(s); - if (!(result = (char*)realloc(result, len + this_len + 1))) { + const size_t this_len = strlen(s); + char* new_result = (char*)realloc(result, len + this_len + 1); + if (!new_result) { free(result); LILV_ERROR("realloc() failed\n"); return NULL; } + result = new_result; memcpy(result + len, s, this_len); len += this_len; } diff --git a/utils/lv2bench.c b/utils/lv2bench.c index 30a4aaf..e585fbd 100644 --- a/utils/lv2bench.c +++ b/utils/lv2bench.c @@ -95,6 +95,7 @@ bench(const LilvPlugin* p, uint32_t sample_count, uint32_t block_size) fprintf(stderr, "<%s> requires feature <%s>, skipping\n", uri, lilv_node_as_uri(feature)); free(buf); + uri_table_destroy(&uri_table); return 0.0; } } @@ -104,6 +105,7 @@ bench(const LilvPlugin* p, uint32_t sample_count, uint32_t block_size) fprintf(stderr, "Failed to instantiate <%s>\n", lilv_node_as_uri(lilv_plugin_get_uri(p))); free(buf); + uri_table_destroy(&uri_table); return 0.0; } @@ -128,6 +130,7 @@ bench(const LilvPlugin* p, uint32_t sample_count, uint32_t block_size) lilv_instance_free(instance); free(buf); free(controls); + uri_table_destroy(&uri_table); return 0.0; } } else if (lilv_port_is_a(p, port, atom_AtomPort)) { @@ -138,6 +141,7 @@ bench(const LilvPlugin* p, uint32_t sample_count, uint32_t block_size) lilv_instance_free(instance); free(buf); free(controls); + uri_table_destroy(&uri_table); return 0.0; } } |