mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-12-03 09:32:02 +00:00
avoid null dereferences in delete_fluid_ladspa_plugin()
be extremely paranoid as suggested by clang-tidy
This commit is contained in:
parent
6c69b8ccff
commit
c205e0162d
1 changed files with 6 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue