]> git.alsa-project.org Git - alsa-lib.git/commitdiff
fix segfault then hooks list is empty
authorSasha Khapyorsky <sashak@smlink.com>
Mon, 12 Sep 2005 10:35:07 +0000 (10:35 +0000)
committerTakashi Iwai <tiwai@suse.de>
Mon, 12 Sep 2005 10:35:07 +0000 (10:35 +0000)
This fix prevents segfaulting then hooks list is empty.

Signed-off-by: Sasha Khapyorsky <sashak@smlink.com>
src/pcm/pcm_hooks.c

index 84d866e753a84e97f8b3ffe9e2f34cfbc5232d92..7f6f09aa663e1e637c4d7f327403ad4fe6656c20 100644 (file)
@@ -469,7 +469,7 @@ int _snd_pcm_hooks_open(snd_pcm_t **pcmp, const char *name,
                return err;
        }
        if (!hooks)
-               return 0;
+               goto _done;
        snd_config_for_each(i, next, hooks) {
                snd_config_t *n = snd_config_iterator_entry(i);
                const char *str;
@@ -488,6 +488,7 @@ int _snd_pcm_hooks_open(snd_pcm_t **pcmp, const char *name,
                        return err;
                }
        }
+ _done:
        *pcmp = rpcm;
        return 0;
 }