mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
pipewire: module-filter-chain: builtin_plugin: fix filename leak
The `filenames` array must be cleared before the `samples == NULL` check otherwise the `strdup()`ed strings will be leaked in case of failure.
This commit is contained in:
parent
b31cf7ac30
commit
75c77b9116
1 changed files with 5 additions and 4 deletions
|
|
@ -979,15 +979,16 @@ static void * convolver_instantiate(const struct fc_descriptor * Descriptor,
|
|||
samples = resample_buffer(samples, &n_samples,
|
||||
rate, SampleRate, resample_quality);
|
||||
}
|
||||
if (samples == NULL) {
|
||||
errno = ENOENT;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (i = 0; i < MAX_RATES; i++)
|
||||
if (filenames[i])
|
||||
free(filenames[i]);
|
||||
|
||||
if (samples == NULL) {
|
||||
errno = ENOENT;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (blocksize <= 0)
|
||||
blocksize = SPA_CLAMP(n_samples, 64, 256);
|
||||
if (tailsize <= 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue