b35a2527db
- backport upstream fixes: fix noresample hw_params rule and a few fixes for missing free() OBS-URL: https://build.opensuse.org/request/show/85033 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa?expand=0&rev=95
71 lines
3.8 KiB
Diff
71 lines
3.8 KiB
Diff
From 03aa1a57c99460489815bf301e554c4d0a638bf6 Mon Sep 17 00:00:00 2001
|
|
From: Julia Lawall <julia@diku.dk>
|
|
Date: Sun, 18 Sep 2011 22:04:36 +0200
|
|
Subject: [PATCH 3/5] src/pcm/pcm_ladspa.c: add missing free
|
|
|
|
Something that is allocated using calloc is not freed on some
|
|
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>
|
|
---
|
|
src/pcm/pcm_ladspa.c | 16 ++++++++++++----
|
|
1 files changed, 12 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/src/pcm/pcm_ladspa.c b/src/pcm/pcm_ladspa.c
|
|
index c413c10..84ebaa5 100644
|
|
--- a/src/pcm/pcm_ladspa.c
|
|
+++ b/src/pcm/pcm_ladspa.c
|
|
@@ -750,8 +750,10 @@ static int snd_pcm_ladspa_allocate_memory(snd_pcm_t *pcm, snd_pcm_ladspa_t *lads
|
|
if (instance->input.data == NULL ||
|
|
instance->input.m_data == NULL ||
|
|
instance->output.data == NULL ||
|
|
- instance->output.m_data == NULL)
|
|
+ instance->output.m_data == NULL) {
|
|
+ free(pchannels);
|
|
return -ENOMEM;
|
|
+ }
|
|
for (idx = 0; idx < instance->input.channels.size; idx++) {
|
|
chn = instance->output.channels.array[idx];
|
|
if (pchannels[chn] == NULL && chn < ichannels) {
|
|
@@ -761,8 +763,10 @@ static int snd_pcm_ladspa_allocate_memory(snd_pcm_t *pcm, snd_pcm_ladspa_t *lads
|
|
instance->input.data[idx] = pchannels[chn];
|
|
if (instance->input.data[idx] == NULL) {
|
|
instance->input.data[idx] = snd_pcm_ladspa_allocate_zero(ladspa, 0);
|
|
- if (instance->input.data[idx] == NULL)
|
|
+ if (instance->input.data[idx] == NULL) {
|
|
+ free(pchannels);
|
|
return -ENOMEM;
|
|
+ }
|
|
}
|
|
}
|
|
for (idx = 0; idx < instance->output.channels.size; idx++) {
|
|
@@ -770,8 +774,10 @@ static int snd_pcm_ladspa_allocate_memory(snd_pcm_t *pcm, snd_pcm_ladspa_t *lads
|
|
/* FIXME/OPTIMIZE: check if we can remove double alloc */
|
|
/* if LADSPA plugin has no broken inplace */
|
|
instance->output.data[idx] = malloc(sizeof(LADSPA_Data) * ladspa->allocated);
|
|
- if (instance->output.data[idx] == NULL)
|
|
+ if (instance->output.data[idx] == NULL) {
|
|
+ free(pchannels);
|
|
return -ENOMEM;
|
|
+ }
|
|
pchannels[chn] = instance->output.m_data[idx] = instance->output.data[idx];
|
|
}
|
|
}
|
|
@@ -793,8 +799,10 @@ static int snd_pcm_ladspa_allocate_memory(snd_pcm_t *pcm, snd_pcm_ladspa_t *lads
|
|
instance->output.data[idx] = NULL;
|
|
} else {
|
|
instance->output.data[idx] = snd_pcm_ladspa_allocate_zero(ladspa, 1);
|
|
- if (instance->output.data[idx] == NULL)
|
|
+ if (instance->output.data[idx] == NULL) {
|
|
+ free(pchannels);
|
|
return -ENOMEM;
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
--
|
|
1.7.6.1
|
|
|