mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-02 09:01:48 -05:00
src/pcm/pcm_rate.c: add missing free
Something that is allocated using calloc is not freed on one or more error paths. Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Suman Saha <sumsaha@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
6dab1a91cb
commit
2a7f653b7f
1 changed files with 4 additions and 0 deletions
|
|
@ -1392,11 +1392,13 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
|
|||
} else {
|
||||
SNDERR("Invalid type for rate converter");
|
||||
snd_pcm_close(pcm);
|
||||
free(rate);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (err < 0) {
|
||||
SNDERR("Cannot find rate converter");
|
||||
snd_pcm_close(pcm);
|
||||
free(rate);
|
||||
return -ENOENT;
|
||||
}
|
||||
#else
|
||||
|
|
@ -1405,6 +1407,7 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
|
|||
err = open_func(SND_PCM_RATE_PLUGIN_VERSION, &rate->obj, &rate->ops);
|
||||
if (err < 0) {
|
||||
snd_pcm_close(pcm);
|
||||
free(rate);
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1413,6 +1416,7 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
|
|||
! rate->ops.input_frames || ! rate->ops.output_frames) {
|
||||
SNDERR("Inproper rate plugin %s initialization", type);
|
||||
snd_pcm_close(pcm);
|
||||
free(rate);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue