mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
PCM: Fix the invalid snd_pcm_close() calls in rate plugin
It happens in the error path, should call snd_pcm_free() instead. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
a9f395e97c
commit
4bdb09126a
1 changed files with 4 additions and 4 deletions
|
|
@ -1394,13 +1394,13 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
|
|||
}
|
||||
} else {
|
||||
SNDERR("Invalid type for rate converter");
|
||||
snd_pcm_close(pcm);
|
||||
snd_pcm_free(pcm);
|
||||
free(rate);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (err < 0) {
|
||||
SNDERR("Cannot find rate converter");
|
||||
snd_pcm_close(pcm);
|
||||
snd_pcm_free(pcm);
|
||||
free(rate);
|
||||
return -ENOENT;
|
||||
}
|
||||
|
|
@ -1409,7 +1409,7 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
|
|||
open_func = SND_PCM_RATE_PLUGIN_ENTRY(linear);
|
||||
err = open_func(SND_PCM_RATE_PLUGIN_VERSION, &rate->obj, &rate->ops);
|
||||
if (err < 0) {
|
||||
snd_pcm_close(pcm);
|
||||
snd_pcm_free(pcm);
|
||||
free(rate);
|
||||
return err;
|
||||
}
|
||||
|
|
@ -1418,7 +1418,7 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
|
|||
if (! rate->ops.init || ! (rate->ops.convert || rate->ops.convert_s16) ||
|
||||
! rate->ops.input_frames || ! rate->ops.output_frames) {
|
||||
SNDERR("Inproper rate plugin %s initialization", type);
|
||||
snd_pcm_close(pcm);
|
||||
snd_pcm_free(pcm);
|
||||
free(rate);
|
||||
return err;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue