aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/echo.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-05-21 03:27:51 -0700
committerChris Robinson <[email protected]>2016-05-21 03:27:51 -0700
commit2e7ec3979aec71f11c45b737b77d58978cbee7e2 (patch)
treec931d2f9b55cc6803a00896f92793a58de8fdc11 /Alc/effects/echo.c
parent7bf64eaee0788b7eb64c7410384a9ee66f75c4ce (diff)
Avoid using realloc in a number of places
Diffstat (limited to 'Alc/effects/echo.c')
-rw-r--r--Alc/effects/echo.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Alc/effects/echo.c b/Alc/effects/echo.c
index 0632a44d..163b6ecb 100644
--- a/Alc/effects/echo.c
+++ b/Alc/effects/echo.c
@@ -52,7 +52,7 @@ typedef struct ALechoState {
static ALvoid ALechoState_Destruct(ALechoState *state)
{
- free(state->SampleBuffer);
+ al_free(state->SampleBuffer);
state->SampleBuffer = NULL;
ALeffectState_Destruct(STATIC_CAST(ALeffectState,state));
}
@@ -69,10 +69,10 @@ static ALboolean ALechoState_deviceUpdate(ALechoState *state, ALCdevice *Device)
if(maxlen != state->BufferLength)
{
- void *temp;
-
- temp = realloc(state->SampleBuffer, maxlen * sizeof(ALfloat));
+ void *temp = al_calloc(16, maxlen * sizeof(ALfloat));
if(!temp) return AL_FALSE;
+
+ al_free(state->SampleBuffer);
state->SampleBuffer = temp;
state->BufferLength = maxlen;
}