From 7c5188a577030544af0550f2d72c958321aa9e4e Mon Sep 17 00:00:00 2001 From: Zero0one1 Date: Tue, 6 Apr 2021 16:45:58 +0800 Subject: 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 `free`ing the resources after usage. Fixes #4910 Co-Authored-By: Zero0one1 Co-Authored-By: Krzmbrzl --- src/mumble/ALSAAudio.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') 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 } -- cgit v1.2.3