Commit ccfb9780 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

- fix invalid free of root object

parent b5040d31
...@@ -244,6 +244,7 @@ void * __vlc_object_create( vlc_object_t *p_this, int i_type ) ...@@ -244,6 +244,7 @@ void * __vlc_object_create( vlc_object_t *p_this, int i_type )
if( !p_new->p_vars ) if( !p_new->p_vars )
{ {
if( i_type != VLC_OBJECT_ROOT )
free( p_new ); free( p_new );
return NULL; return NULL;
} }
...@@ -396,6 +397,8 @@ void __vlc_object_destroy( vlc_object_t *p_this ) ...@@ -396,6 +397,8 @@ void __vlc_object_destroy( vlc_object_t *p_this )
vlc_mutex_destroy( &p_this->object_lock ); vlc_mutex_destroy( &p_this->object_lock );
vlc_cond_destroy( &p_this->object_wait ); vlc_cond_destroy( &p_this->object_wait );
/* root is not dynamically allocated by vlc_object_create */
if( p_this->i_object_type != VLC_OBJECT_ROOT )
free( p_this ); free( p_this );
} }
......
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