output/alsa: default "device" is an empty string
Fixes nullptr dereference in std::string::operator=(). Also fixes a memory leak by using config_get_block_string() instead of config_dup_block_string().
This commit is contained in:
parent
5692e20fd5
commit
7e92820c50
@ -137,7 +137,7 @@ alsa_device(const AlsaOutput *ad)
|
||||
static void
|
||||
alsa_configure(AlsaOutput *ad, const struct config_param *param)
|
||||
{
|
||||
ad->device = config_dup_block_string(param, "device", NULL);
|
||||
ad->device = config_get_block_string(param, "device", "");
|
||||
|
||||
ad->use_mmap = config_get_block_bool(param, "use_mmap", false);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user