alsactl: fix lock_fd unlock in load_configuration() - error path

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2021-06-04 10:08:18 +02:00
parent 646d6ff094
commit cd2f779b8d

View file

@ -220,15 +220,17 @@ int load_configuration(const char *file, snd_config_t **top, int *open_failed)
}
err = snd_config_load(config, in);
snd_input_close(in);
if (lock_fd >= 0)
state_unlock(lock_fd, file);
if (err < 0) {
error("snd_config_load error: %s", snd_strerror(err));
out:
if (lock_fd >= 0)
state_unlock(lock_fd, file);
snd_config_delete(config);
snd_config_update_free_global();
return err;
} else {
if (lock_fd >= 0)
state_unlock(lock_fd, file);
*top = config;
return 0;
}