Commit 7e92820c authored by Max Kellermann's avatar Max Kellermann

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().
parent 5692e20f
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment