diff --git a/src/midi.c b/src/midi.c index d834d98..98b4c50 100644 --- a/src/midi.c +++ b/src/midi.c @@ -74,6 +74,12 @@ void *midi_background_listen(void *args) { snd_rawmidi_info_malloc(&info); + if (info == NULL) { + log_error("(%s) failed to allocate MIDI info", device->name); + free(process_args); + pthread_exit(NULL); + } + while (!context->stop && snd_rawmidi_info(device->output, info) == 0) { bytes_read = snd_rawmidi_read(device->input, buffer, 3); if (bytes_read == 3) {