Commit bea81bc1 authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf

MKV: fix a memory leak

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 84cb607a
...@@ -192,11 +192,10 @@ static int Open( vlc_object_t * p_this ) ...@@ -192,11 +192,10 @@ static int Open( vlc_object_t * p_this )
// test whether this file belongs to our family // test whether this file belongs to our family
const uint8_t *p_peek; const uint8_t *p_peek;
bool file_ok = false; bool file_ok = false;
#warning Memory leak! char *psz_url = vlc_path2uri( s_filename.c_str(), "file" );
std::string s_url = vlc_path2uri( s_filename.c_str(), "file" );
stream_t *p_file_stream = stream_UrlNew( stream_t *p_file_stream = stream_UrlNew(
p_demux, p_demux,
s_url.c_str() ); psz_url );
/* peek the begining */ /* peek the begining */
if( p_file_stream && if( p_file_stream &&
stream_Peek( p_file_stream, &p_peek, 4 ) >= 4 stream_Peek( p_file_stream, &p_peek, 4 ) >= 4
...@@ -230,6 +229,7 @@ static int Open( vlc_object_t * p_this ) ...@@ -230,6 +229,7 @@ static int Open( vlc_object_t * p_this )
} }
msg_Dbg( p_demux, "the file '%s' cannot be opened", s_filename.c_str() ); msg_Dbg( p_demux, "the file '%s' cannot be opened", s_filename.c_str() );
} }
free( psz_url );
} }
} }
} }
......
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