Handle malloc failure in mode_create gracefully without leaking memory.

This commit is contained in:
Gregory Maxwell 2009-06-04 17:17:35 -04:00 committed by Jean-Marc Valin
parent 1716999bbe
commit dc67fa9a4c
6 changed files with 122 additions and 21 deletions

View file

@ -179,8 +179,8 @@ void celt_encoder_destroy(CELTEncoder *st)
if (st->marker == ENCODERFREED)
{
return;
celt_warning("Freeing an encoder which has already been freed");
return;
}
if (st->marker != ENCODERVALID && st->marker != ENCODERPARTIAL)