]> git.alsa-project.org Git - alsa-utils.git/commit
alsactl: load_state: Only delete config if one was loaded
authorSören Tempel <soeren+git@soeren-tempel.net>
Sun, 6 Jun 2021 01:14:19 +0000 (03:14 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 7 Jun 2021 17:06:19 +0000 (19:06 +0200)
commit6018c2014ac24877b2aa58c2c57f2fd901e6c7b1
tree1d649f437969276966813ce3c4e02f659fbd2f79
parentf138117a457944ca73776bd752693d64ec207e55
alsactl: load_state: Only delete config if one was loaded

If load_configuration fails with open_failed == true, load_state will
jump to the out label without config being initialized and pass this
uninitialized config value to snd_config_delete. This commit fixes this
issue by initializing config with NULL and checking if it is non-null
before invoking snd_config_delete.

Fixes: https://github.com/alsa-project/alsa-utils/pull/94
Fixes: f138117 ("alsactl: load_state() - initialize config variable for the open_failed case")
BugLink: https://github.com/alsa-project/alsa-utils/issues/93
Signed-off-by: Sören Tempel <soeren+git@soeren-tempel.net>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
alsactl/state.c