Commit 881299be authored by Filip Roséen's avatar Filip Roséen Committed by Jean-Baptiste Kempf
Browse files

mkv: removed indirection when initializing std::string



There really is no need to allocate memory for a temporary buffer, copy
the data to this buffer, and then use the buffer to initialize a
std::string, before freeing the buffer.

One of the constructors of std::string can handle the above for us.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent d55cd992
......@@ -706,12 +706,7 @@ bool matroska_script_interpretor_c::Interpret( const binary * p_command, size_t
{
bool b_result = false;
char *psz_str = static_cast<char*>( malloc( i_size + 1 ) );
memcpy( psz_str, p_command, i_size );
psz_str[ i_size ] = '\0';
std::string sz_command = psz_str;
free( psz_str );
std::string sz_command( reinterpret_cast<const char*> (p_command), i_size );
msg_Dbg( &sys.demuxer, "command : %s", sz_command.c_str() );
......
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