Skip to content

Commit

Permalink
FIX(client): Memory leak in ALSA implementation
Browse files Browse the repository at this point in the history
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 mumble-voip#4910

Co-Authored-By: Zero0one1 <[email protected]>
Co-Authored-By: Krzmbrzl <[email protected]>
  • Loading branch information
Zero0one1 and Krzmbrzl committed Apr 6, 2021
1 parent 7e64683 commit 7c5188a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mumble/ALSAAudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,10 @@ ALSAEnumerator::ALSAEnumerator() {
}
snd_pcm_info_free(info);
snd_ctl_close(ctl);
free(cname);
}
snd_card_next(&card);
free(name);
}
#endif
}
Expand Down

0 comments on commit 7c5188a

Please sign in to comment.