[alsa-devel] [PATCH] alsa-lib: snd_device_name_hint misbehaving

Takashi Iwai tiwai at suse.de
Tue Nov 3 08:13:41 CET 2009


At Mon, 02 Nov 2009 13:12:21 -0500,
John Lindgren wrote:
> 
> On Mon, 2009-11-02 at 07:21 +0100, Jaroslav Kysela wrote:
> > On Sun, 1 Nov 2009, John Lindgren wrote:
> > 
> > > * Remove erroneous snd_config_delete calls that cause later calls to
> > > snd_pcm_open to fail.
> > 
> > It does not look good. Have you checked with valgrind if there are no 
> > memory leaks?
> 
> You're making the same mistake that the original author of the code
> made.  snd_config_delete is not a call to free memory; it is a call to
> remove sections of the loaded configuration.  The configuration nodes
> that were being passed to snd_config_delete were returned by
> snd_config_search, which returns direct pointers to the actual nodes in
> the configuration.  It does no memory duplication.

Well, no, the code there should be OK.  It's the place to replace the
whole sub-tree by overriding the object.  Thus, freeing the object
returned from snd_config_search() is correct.

The problem is rather in namehint.c, as found in my patch in another
post.

> > Please, split your changes to single patches. Thanks.
> 
> I will do so when I have the time to learn Git a little better.  (I
> normally use Mercurial).

This is easy even without VCS.  Just split your own patch to several
files by an editor :)   Namely, the change of dlmisc.c, and the
addition of "ctl" check in namehint.c.


thanks,

Takashi


More information about the Alsa-devel mailing list