diff --git a/src/bindings/fluid_ladspa.c b/src/bindings/fluid_ladspa.c index 8b33d560..ddf90fed 100644 --- a/src/bindings/fluid_ladspa.c +++ b/src/bindings/fluid_ladspa.c @@ -1113,12 +1113,17 @@ new_fluid_ladspa_plugin(fluid_ladspa_fx_t *fx, const fluid_ladspa_lib_t *lib, co static void delete_fluid_ladspa_plugin(fluid_ladspa_plugin_t *plugin) { + if (plugin == NULL) + { + return; + } + if (plugin->ports != NULL) { FLUID_FREE(plugin->ports); } - if (plugin->handle != NULL) + if (plugin->handle != NULL && plugin->desc != NULL && plugin->desc->cleanup != NULL) { plugin->desc->cleanup(plugin->handle); }