Commit: d2225033d5b3acd9b8d8231f341e22f7cc776b4d
Parent: 492d541a2af303d3822ce7adb597fdadbc998572
Author: Randy Palamar
Date: Tue, 16 Mar 2021 21:44:22 -0600
fix alsa mem leak in volume.c
since I think I found this the first time I wrote that function I left
a comment so I don't outsmart myself again
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/blocks/volume.c b/blocks/volume.c
@@ -38,7 +38,9 @@ getvol(struct Block *b)
/* covert from raw value to percent */
vol = (double)(vol - min) / (double)(max - min) * 100;
- snd_mixer_elem_free(elem);
+ /* don't change to snd_mixer_elem_free() it leaks memory */
+ snd_mixer_close(handle);
+ snd_mixer_selem_id_free(sid);
if (notmuted) {
if (abs(vol) < 100)