Remove unnecessary free of global stack on error

This commit is contained in:
Jean-Marc Valin 2010-06-08 21:01:41 -04:00
parent e2d5b33780
commit 9a33c5c346

View file

@ -280,10 +280,7 @@ CELTMode *celt_mode_create(celt_int32 Fs, int frame_size, int *error)
ALLOC_STACK; ALLOC_STACK;
#if !defined(VAR_ARRAYS) && !defined(USE_ALLOCA) #if !defined(VAR_ARRAYS) && !defined(USE_ALLOCA)
if (global_stack==NULL) if (global_stack==NULL)
{
celt_free(global_stack);
goto failure; goto failure;
}
#endif #endif
for (i=0;i<TOTAL_MODES;i++) for (i=0;i<TOTAL_MODES;i++)
{ {
@ -314,10 +311,7 @@ CELTMode *celt_mode_create(celt_int32 Fs, int frame_size, int *error)
ALLOC_STACK; ALLOC_STACK;
#if !defined(VAR_ARRAYS) && !defined(USE_ALLOCA) #if !defined(VAR_ARRAYS) && !defined(USE_ALLOCA)
if (global_stack==NULL) if (global_stack==NULL)
{
celt_free(global_stack);
goto failure; goto failure;
}
#endif #endif
/* The good thing here is that permutation of the arguments will automatically be invalid */ /* The good thing here is that permutation of the arguments will automatically be invalid */