diff options
author | Robert Adam <dev@robert-adam.de> | 2021-04-06 12:52:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-06 12:52:39 +0300 |
commit | 6e0ab7a6ae739273a541361973f13a60318ab2a2 (patch) | |
tree | aa4d070c542e1a7dc9e7b83fcfffe8c3fc1dfa6b /src | |
parent | 9b070db5da04794b8b8a510a054aa37f90adb822 (diff) | |
parent | 7c5188a577030544af0550f2d72c958321aa9e4e (diff) |
Merge PR #4916: FIX(client): Memory leak in ALSA implementation
The functions snd_card_get_name and snd_card_get_longname allocate a
String for the caller that needs to be freed once it is no longer needed.
This was not done in the current implementation and thus this was causing
a memory leak.
This commit fixes this by explicitly freeing the resources after usage.
Fixes #4910
Ref: alsa-project.org/alsa-doc/alsa-lib/group___control.html#ga547dcead4a72f24db4a0f9f530f75228
Diffstat (limited to 'src')
-rw-r--r-- | src/mumble/ALSAAudio.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mumble/ALSAAudio.cpp b/src/mumble/ALSAAudio.cpp index 7053e6ffb..9a0d9e6eb 100644 --- a/src/mumble/ALSAAudio.cpp +++ b/src/mumble/ALSAAudio.cpp @@ -252,8 +252,10 @@ ALSAEnumerator::ALSAEnumerator() { } snd_pcm_info_free(info); snd_ctl_close(ctl); + free(cname); } snd_card_next(&card); + free(name); } #endif } |