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

mjpeg: fix leak

parent 9e829b57
...@@ -151,7 +151,7 @@ static char* GetLine( demux_t *p_demux, int *p_pos ) ...@@ -151,7 +151,7 @@ static char* GetLine( demux_t *p_demux, int *p_pos )
{ {
i--; i--;
} }
p_line = malloc( i + 1 ); p_line = vlc_obj_malloc( p_demux, i + 1 );
if( unlikely( p_line == NULL ) ) if( unlikely( p_line == NULL ) )
return NULL; return NULL;
strncpy ( p_line, (char*)p_buf, i ); strncpy ( p_line, (char*)p_buf, i );
...@@ -214,7 +214,7 @@ static bool CheckMimeHeader( demux_t *p_demux, int *p_header_size ) ...@@ -214,7 +214,7 @@ static bool CheckMimeHeader( demux_t *p_demux, int *p_header_size )
msg_Warn( p_demux, "separator %s does not match %s", psz_line, msg_Warn( p_demux, "separator %s does not match %s", psz_line,
p_sys->psz_separator ); p_sys->psz_separator );
} }
free( psz_line ); vlc_obj_free( p_demux, psz_line );
} }
} }
...@@ -239,7 +239,7 @@ static bool CheckMimeHeader( demux_t *p_demux, int *p_header_size ) ...@@ -239,7 +239,7 @@ static bool CheckMimeHeader( demux_t *p_demux, int *p_header_size )
{ {
msg_Dbg( p_demux, "discard MIME header: %s", psz_line ); msg_Dbg( p_demux, "discard MIME header: %s", psz_line );
} }
free( psz_line ); vlc_obj_free( p_demux, psz_line );
psz_line = GetLine( p_demux, &i_pos ); psz_line = GetLine( p_demux, &i_pos );
} }
...@@ -249,7 +249,7 @@ static bool CheckMimeHeader( demux_t *p_demux, int *p_header_size ) ...@@ -249,7 +249,7 @@ static bool CheckMimeHeader( demux_t *p_demux, int *p_header_size )
return false; return false;
} }
free( psz_line ); vlc_obj_free( p_demux, psz_line );
*p_header_size = i_pos; *p_header_size = i_pos;
return b_jpeg; return b_jpeg;
......
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