20 Jul
2010
20 Jul
'10
9:26 p.m.
get_card_name() can be called more than once on the same list, so it must free the previous list->cardname before replacing it.
Signed-off-by: John Lindgren john.lindgren@tds.net ---
src/control/namehint.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/control/namehint.c b/src/control/namehint.c index 78572d8..fc1cb27 100644 --- a/src/control/namehint.c +++ b/src/control/namehint.c @@ -471,6 +471,8 @@ static int get_card_name(struct hint_list *list, int card) char scard[16], *s; int err;
+ if (list->cardname) + free(list->cardname); err = snd_card_get_name(card, &list->cardname); if (err <= 0) return 0;