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:
Barnabás Pőcze 2023-12-02 20:45:54 +01:00 committed by Wim Taymans
parent b31cf7ac30
commit 75c77b9116

View file

@ -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)