Re: [PATCH] [updated] pcm: rate: Add capability to pass configuration node to plugins

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 21 Feb 2017 16:24:06 +0100,
Alan Young wrote:
> 
> On 21/02/17 15:14, Takashi Iwai wrote:
> > On Tue, 21 Feb 2017 16:04:54 +0100,
> > Alan Young wrote:
> >> +	else if (snd_config_get_type(converter) == SND_CONFIG_TYPE_COMPOUND) {
> >> +		snd_config_iterator_t i, next;
> >> +		snd_config_for_each(i, next, converter) {
> >> +			snd_config_t *n = snd_config_iterator_entry(i);
> >> +			const char *id;
> >> +			snd_config_get_id(n, &id);
> >> +			if (strcmp(id, "name") != 0)
> >> +				continue;
> >> +			snd_config_get_string(n, &type);
> >> +			break;
> >> +		}
> >> +		if (!type) {
> >> +			SNDERR("No name given for rate converter");
> >> +			return -EINVAL;
> > Resource leaks.
> >
> >
> Can you expand on that a little please? What leaks?

You forgot to call

	snd_pcm_free(pcm);
	free(rate);

before returning an error.

Ideally, all these calls should be moved to a single place and we'd
call like "goto error", but it's a thing to be done by another patch.


Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux