alsa: close the sequence on error.

This commit is contained in:
Wim Taymans 2025-01-19 15:56:01 +01:00
parent e4fc8d43bb
commit 9889d1ce0a

View file

@ -37,8 +37,12 @@ static int seq_open(struct seq_state *state, struct seq_conn *conn, bool with_qu
0)) < 0)
return res;
if ((res = snd_seq_set_client_midi_version(conn->hndl, SND_SEQ_CLIENT_UMP_MIDI_2_0)) < 0)
if ((res = snd_seq_set_client_midi_version(conn->hndl, SND_SEQ_CLIENT_UMP_MIDI_2_0)) < 0) {
snd_seq_close(conn->hndl);
spa_log_info(state->log, "%p: ALSA failed to enable UMP MIDI: %s",
state, snd_strerror(res));
return res;
}
return 0;
}