alsa-mixer: prevent double-free on decibel fixes object key
authorIgor V. Kovalenko <igor.v.kovalenko@gmail.com>
Tue, 1 Jun 2021 17:27:03 +0000 (20:27 +0300)
committerIgor V. Kovalenko <igor.v.kovalenko@gmail.com>
Tue, 1 Jun 2021 17:34:54 +0000 (20:34 +0300)
commit411c087095e1cb8e9d3ef5b1c850a98b81f7fa44
tree1f75c1907cf64ec9f77fdb8a8ab15bd4c2fe3b4a
parent3a1affa175fdb870171ecc2fd608c84b518987e8
alsa-mixer: prevent double-free on decibel fixes object key

When decibel fixes object is cloned, there is only a shallow copy of `key`
string member of original object. This may lead to double-free crash reported in
pipewire tracker https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1125

Fix this by doing a deep copy of `key` string to maintain correct ownership.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/569>
src/modules/alsa/alsa-mixer.c