diff options
author | Max Kellermann <max@duempel.org> | 2013-02-04 11:46:49 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-02-04 11:46:49 +0100 |
commit | 7e92820c501eef548ddcc64b345dfdbf82f708ad (patch) | |
tree | d71a81bdec71550f449eeb1c2fef5c51a6770459 /src/output/AlsaOutputPlugin.cxx | |
parent | 5692e20fd50b658537a9c6d8d11e5be35a21fb2e (diff) | |
download | mpd-7e92820c501eef548ddcc64b345dfdbf82f708ad.tar.gz mpd-7e92820c501eef548ddcc64b345dfdbf82f708ad.tar.xz mpd-7e92820c501eef548ddcc64b345dfdbf82f708ad.zip |
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().
Diffstat (limited to '')
-rw-r--r-- | src/output/AlsaOutputPlugin.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/output/AlsaOutputPlugin.cxx b/src/output/AlsaOutputPlugin.cxx index 4d9f259ad..b4c8d938b 100644 --- a/src/output/AlsaOutputPlugin.cxx +++ b/src/output/AlsaOutputPlugin.cxx @@ -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); |