Commit 669ee735 authored by JP Dinger's avatar JP Dinger

Fix memleak when out of memory.

parent c4d7ae8e
...@@ -176,13 +176,16 @@ static int Open( vlc_object_t *p_this ) ...@@ -176,13 +176,16 @@ static int Open( vlc_object_t *p_this )
if( !p_sys ) if( !p_sys )
return VLC_ENOMEM; return VLC_ENOMEM;
vlc_mutex_init( &p_sys->lock );
/* Force new to return 0 on failure instead of throwing, since we don't /* Force new to return 0 on failure instead of throwing, since we don't
want an exception to leak back to C code. Bad things would happen. */ want an exception to leak back to C code. Bad things would happen. */
p_sys->p_reverbm = new (nothrow) revmodel; p_sys->p_reverbm = new (nothrow) revmodel;
if( !p_sys->p_reverbm ) if( !p_sys->p_reverbm )
{
free( p_sys );
return VLC_ENOMEM; return VLC_ENOMEM;
}
vlc_mutex_init( &p_sys->lock );
for(unsigned i=0;i<num_callbacks;++i) for(unsigned i=0;i<num_callbacks;++i)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment