Also reorder the cleanup sequence in app_finalize().
}
app->npfds = snd_seq_poll_descriptors_count (app->seq, POLLIN);
}
app->npfds = snd_seq_poll_descriptors_count (app->seq, POLLIN);
- app->pfds = alloca (sizeof (*app->pfds) * app->npfds);
+ app->pfds = malloc (sizeof (*app->pfds) * app->npfds);
if (app->pfds == NULL) {
ret = -ENOMEM;
goto err_free_buffer;
if (app->pfds == NULL) {
ret = -ENOMEM;
goto err_free_buffer;
app_finalize (App * app)
{
/* free the resources */
app_finalize (App * app)
{
/* free the resources */
snd_midi_event_free (app->parser);
snd_midi_event_free (app->parser);
snd_seq_close (app->seq);
}
snd_seq_close (app->seq);
}