From eef9183fadba848612fb80bb8f937e758c470114 Mon Sep 17 00:00:00 2001 From: reuk Date: Wed, 27 Aug 2025 14:56:42 +0100 Subject: [PATCH] LV2 Host: Fix leak of LV2 path when calling lilv_world_set_option multiple times --- .../format_types/LV2_SDK/README.md | 10 ++++++---- .../format_types/LV2_SDK/lilv/src/world.c | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/juce_audio_processors/format_types/LV2_SDK/README.md b/modules/juce_audio_processors/format_types/LV2_SDK/README.md index 133356c940..e4b02ab560 100644 --- a/modules/juce_audio_processors/format_types/LV2_SDK/README.md +++ b/modules/juce_audio_processors/format_types/LV2_SDK/README.md @@ -1,11 +1,13 @@ The source code for lilv and its dependent libraries have been copied into this directory. The following modifications were made: -- Removed files not strictly required to build the lilv library, - including generated config headers +- Removed files not strictly required to build the lilv library, including + generated config headers - Added handwritten config headers - Removed the include of dlfcn.h in world.c +- Fixed a leak of world->opt.lv2_path when calling lilv_world_set_option + multiple times -Remember to update the versions in the config headers if you ever update -the library versions! +Remember to update the versions in the config headers if you ever update the +library versions! diff --git a/modules/juce_audio_processors/format_types/LV2_SDK/lilv/src/world.c b/modules/juce_audio_processors/format_types/LV2_SDK/lilv/src/world.c index 0e9bd2e2be..3a601ab85c 100644 --- a/modules/juce_audio_processors/format_types/LV2_SDK/lilv/src/world.c +++ b/modules/juce_audio_processors/format_types/LV2_SDK/lilv/src/world.c @@ -197,6 +197,7 @@ lilv_world_set_option(LilvWorld* world, const char* uri, const LilvNode* value) } } else if (!strcmp(uri, LILV_OPTION_LV2_PATH)) { if (lilv_node_is_string(value)) { + free(world->opt.lv2_path); world->opt.lv2_path = lilv_strdup(lilv_node_as_string(value)); return; }