mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-09 17:05:41 +01:00
alsactl: fix lock_fd unlock in load_configuration() - error path
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
646d6ff094
commit
cd2f779b8d
1 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue