Commit b0aa28e6 authored by Antoine Cellerier's avatar Antoine Cellerier

Fix CID 116 (same as 117 in fact) and a few memleaks (still 0.8.6

specific ... and untested :P)
parent e9651457
...@@ -96,6 +96,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -96,6 +96,7 @@ static int Open( vlc_object_t *p_this )
if( !psz_separator_block ) if( !psz_separator_block )
{ {
free( p_sys ); free( p_sys );
free( psz_separator );
return VLC_ENOMEM; return VLC_ENOMEM;
} }
...@@ -105,6 +106,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -105,6 +106,7 @@ static int Open( vlc_object_t *p_this )
memcpy( p_sys->p_separator->p_buffer, psz_separator_block , i_size ); memcpy( p_sys->p_separator->p_buffer, psz_separator_block , i_size );
free( psz_separator_block ); free( psz_separator_block );
free( psz_separator );
p_mux->pf_control = Control; p_mux->pf_control = Control;
p_mux->pf_addstream = AddStream; p_mux->pf_addstream = AddStream;
...@@ -200,6 +202,12 @@ static int Mux( sout_mux_t *p_mux ) ...@@ -200,6 +202,12 @@ static int Mux( sout_mux_t *p_mux )
char *psz_separator_block = (char *)malloc( strlen( psz_separator ) + char *psz_separator_block = (char *)malloc( strlen( psz_separator ) +
2 + strlen( CONTENT_TYPE ) ); 2 + strlen( CONTENT_TYPE ) );
if( !psz_seperator_block )
{
free( psz_separator );
return VLC_EGENERIC;
}
sprintf( psz_separator_block, "%s\r\n%s\r\n", psz_separator, sprintf( psz_separator_block, "%s\r\n%s\r\n", psz_separator,
CONTENT_TYPE ); CONTENT_TYPE );
...@@ -209,7 +217,9 @@ static int Mux( sout_mux_t *p_mux ) ...@@ -209,7 +217,9 @@ static int Mux( sout_mux_t *p_mux )
p_header->i_flags |= BLOCK_FLAG_HEADER; p_header->i_flags |= BLOCK_FLAG_HEADER;
sout_AccessOutWrite( p_mux->p_access, p_header ); sout_AccessOutWrite( p_mux->p_access, p_header );
p_sys->b_send_headers = VLC_FALSE; p_sys->b_send_headers = VLC_FALSE;
if( psz_separator_block ) free( psz_separator_block );
free( psz_separator );
free( psz_separator_block );
} }
if( !p_mux->i_nb_inputs ) return VLC_SUCCESS; if( !p_mux->i_nb_inputs ) return VLC_SUCCESS;
......
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