]> git.alsa-project.org Git - alsa-lib.git/commit
Fix corruption after snd_device_name_hint()
authorTakashi Iwai <tiwai@suse.de>
Tue, 3 Nov 2009 07:57:10 +0000 (08:57 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 3 Nov 2009 08:02:39 +0000 (09:02 +0100)
commite1c7dd261347f6a0b9ad56e52bb86dfe057cfb9a
tree0d158c7122c2e9e54bc6ec80091f4cabd9c62860
parent0110d62043589f0e3344d7af7ed33ac52da6b596
Fix corruption after snd_device_name_hint()

snd_device_name_hint() corrupts the config name space after its call.
This results in the error from the suceeding calls of snd_pcm_open()
after snd_device_name_hint().

The bug is in try_config() in namehint.c; it calls snd_config_delete(res)
but res can be two different objects in the function.  One is the object
obtained via snd_config_search_definition(), and another is the one from
snd_config_search_alias_hooks().  The former is the expanded objects,
thus it should be freed.  But, the latter is a reference, and must not be
freed.

This patch adds the check to free or not.

Reported-by: John Lindgren <john.lindgren@tds.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/control/namehint.c