mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-12-15 08:56:36 -05:00
fix segfault then hooks list is empty
This fix prevents segfaulting then hooks list is empty. Signed-off-by: Sasha Khapyorsky <sashak@smlink.com>
This commit is contained in:
parent
19284bd325
commit
474eb76b71
1 changed files with 2 additions and 1 deletions
|
|
@ -469,7 +469,7 @@ int _snd_pcm_hooks_open(snd_pcm_t **pcmp, const char *name,
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
if (!hooks)
|
if (!hooks)
|
||||||
return 0;
|
goto _done;
|
||||||
snd_config_for_each(i, next, hooks) {
|
snd_config_for_each(i, next, hooks) {
|
||||||
snd_config_t *n = snd_config_iterator_entry(i);
|
snd_config_t *n = snd_config_iterator_entry(i);
|
||||||
const char *str;
|
const char *str;
|
||||||
|
|
@ -488,6 +488,7 @@ int _snd_pcm_hooks_open(snd_pcm_t **pcmp, const char *name,
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
_done:
|
||||||
*pcmp = rpcm;
|
*pcmp = rpcm;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue