Added missing initialization and check for sctl contents

This commit is contained in:
Jaroslav Kysela 2001-12-29 22:30:22 +00:00
parent f64ec1b32d
commit 290810864b

View file

@ -630,7 +630,7 @@ int _snd_pcm_hook_ctl_elems_install(snd_pcm_t *pcm, snd_config_t *conf)
snd_pcm_info_t *info;
char ctl_name[16];
snd_ctl_t *ctl;
snd_sctl_t *sctl;
snd_sctl_t *sctl = NULL;
snd_config_t *pcm_conf = NULL;
snd_pcm_hook_t *h_hw_params = NULL, *h_hw_free = NULL, *h_close = NULL;
assert(conf);
@ -676,6 +676,7 @@ int _snd_pcm_hook_ctl_elems_install(snd_pcm_t *pcm, snd_config_t *conf)
snd_pcm_hook_remove(h_hw_free);
if (h_close)
snd_pcm_hook_remove(h_close);
if (sctl)
snd_sctl_free(sctl);
if (pcm_conf)
snd_config_delete(pcm_conf);