MidiSettings: Don't leak settings in failure case.

CID 1422944.
This commit is contained in:
Augustin Cavalier 2017-11-23 18:12:54 +01:00
parent d692d22c9d
commit a20f4f8a85

View File

@ -37,8 +37,10 @@ read_midi_settings(struct midi_settings* settings)
const char* soundfont = get_driver_parameter(handle, "soundfont", NULL,
NULL);
if (soundfont == NULL)
if (soundfont == NULL) {
unload_driver_settings(handle);
return B_ERROR;
}
strlcpy(settings->soundfont_file, soundfont,
sizeof(settings->soundfont_file));