mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
filter-chain: fix memory leaks
This commit is contained in:
parent
cf66400035
commit
5bc95234e8
1 changed files with 10 additions and 1 deletions
|
|
@ -657,14 +657,21 @@ static void * convolver_instantiate(const struct fc_descriptor * Descriptor,
|
|||
|
||||
impl = calloc(1, sizeof(*impl));
|
||||
if (impl == NULL)
|
||||
return NULL;
|
||||
goto error;
|
||||
|
||||
impl->rate = *SampleRate;
|
||||
|
||||
impl->conv = convolver_new(blocksize, tailsize, samples, n_samples);
|
||||
if (impl->conv == NULL)
|
||||
goto error;
|
||||
|
||||
free(samples);
|
||||
|
||||
return impl;
|
||||
error:
|
||||
free(samples);
|
||||
free(impl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void convolver_connect_port(void * Instance, unsigned long Port,
|
||||
|
|
@ -677,6 +684,8 @@ static void convolver_connect_port(void * Instance, unsigned long Port,
|
|||
static void convolver_cleanup(void * Instance)
|
||||
{
|
||||
struct convolver_impl *impl = Instance;
|
||||
if (impl->conv)
|
||||
convolver_free(impl->conv);
|
||||
free(impl);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue