fix double free when deleting fluid_seqbind_t

This commit is contained in:
derselbst 2018-05-13 11:38:22 +02:00
parent 36546a9efb
commit 5f70eb8226
2 changed files with 0 additions and 14 deletions

View file

@ -302,36 +302,23 @@ void
fluid_sequencer_unregister_client (fluid_sequencer_t* seq, fluid_seq_id_t id)
{
fluid_list_t *tmp;
fluid_event_t* evt;
if (seq->clients == NULL) return;
evt = new_fluid_event();
if (evt != NULL) {
fluid_event_unregistering(evt);
fluid_event_set_dest(evt, id);
}
tmp = seq->clients;
while (tmp) {
fluid_sequencer_client_t *client = (fluid_sequencer_client_t*)tmp->data;
if (client->id == id) {
/* What should we really do if evt is null due to out-of-memory? */
if (client->callback != NULL && evt != NULL)
(client->callback)(fluid_sequencer_get_tick(seq),
evt, seq, client->data);
if (client->name)
FLUID_FREE(client->name);
seq->clients = fluid_list_remove_link(seq->clients, tmp);
delete1_fluid_list(tmp);
FLUID_FREE(client);
delete_fluid_event(evt);
return;
}
tmp = tmp->next;
}
delete_fluid_event(evt);
return;
}

View file

@ -230,7 +230,6 @@ fluid_seq_fluidsynth_callback(unsigned int time, fluid_event_t* evt, fluid_seque
break;
case FLUID_SEQ_UNREGISTERING: /* free ourselves */
seqbind->client_id = -1; /* avoid recursive call to fluid_sequencer_unregister_client */
delete_fluid_seqbind(seqbind);
break;