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

avi: memory leak

parent 9e9028cd
...@@ -465,7 +465,11 @@ static int Open( vlc_object_t * p_this ) ...@@ -465,7 +465,11 @@ static int Open( vlc_object_t * p_this )
if( fmt.i_extra > 0 ) if( fmt.i_extra > 0 )
{ {
fmt.p_extra = malloc( fmt.i_extra ); fmt.p_extra = malloc( fmt.i_extra );
if( !fmt.p_extra ) goto error; if( unlikely(fmt.p_extra == NULL) )
{
free( tk );
goto error;
}
memcpy( fmt.p_extra, &p_auds->p_wf[1], fmt.i_extra ); memcpy( fmt.p_extra, &p_auds->p_wf[1], fmt.i_extra );
} }
break; break;
...@@ -586,7 +590,11 @@ static int Open( vlc_object_t * p_this ) ...@@ -586,7 +590,11 @@ static int Open( vlc_object_t * p_this )
if( fmt.i_extra > 0 ) if( fmt.i_extra > 0 )
{ {
fmt.p_extra = malloc( fmt.i_extra ); fmt.p_extra = malloc( fmt.i_extra );
if( !fmt.p_extra ) goto error; if( unlikely(fmt.p_extra == NULL) )
{
free( tk );
goto error;
}
memcpy( fmt.p_extra, &p_vids->p_bih[1], fmt.i_extra ); memcpy( fmt.p_extra, &p_vids->p_bih[1], fmt.i_extra );
} }
......
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