From 290810864b82f8eccd4e1238f45956f3bad120d1 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Sat, 29 Dec 2001 22:30:22 +0000 Subject: [PATCH] Added missing initialization and check for sctl contents --- src/pcm/pcm_hooks.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pcm/pcm_hooks.c b/src/pcm/pcm_hooks.c index 892d4356..2d1ff3bb 100644 --- a/src/pcm/pcm_hooks.c +++ b/src/pcm/pcm_hooks.c @@ -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,7 +676,8 @@ 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); - snd_sctl_free(sctl); + if (sctl) + snd_sctl_free(sctl); if (pcm_conf) snd_config_delete(pcm_conf); return err; -- 2.47.1