From f3d7c558306ccff43d2049a8bdcff64f3801ae12 Mon Sep 17 00:00:00 2001 From: Martin Piatka <445597@mail.muni.cz> Date: Mon, 19 Aug 2019 13:14:40 +0200 Subject: [PATCH] Alsa common: Free device hints after printing help --- src/alsa_common.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/alsa_common.h b/src/alsa_common.h index a808e7030..99eba47f6 100644 --- a/src/alsa_common.h +++ b/src/alsa_common.h @@ -49,12 +49,14 @@ static inline void audio_alsa_help(void) { void **hints; + void **hints_it; color_out(COLOR_OUT_BOLD, "\talsa"); printf("%27s default ALSA device (same as \"alsa:default\")\n", ":"); snd_device_name_hint(-1, "pcm", &hints); - while(*hints != NULL) { - char *tmp = strdup(*(char **) hints); + hints_it = hints; + while(*hints_it != NULL) { + char *tmp = strdup(*(char **) hints_it); char *save_ptr = NULL; char *name_part = NULL; char *desc = NULL; @@ -84,10 +86,11 @@ static inline void audio_alsa_help(void) } } printf("\n"); - hints++; + hints_it++; free(tmp); free(name); } + snd_device_name_free_hint(hints); } static const snd_pcm_format_t bps_to_snd_fmts[] = {