The pointer returned is only valid for the statement calling the
function. The temporary QByteArray falls out of scope immediatly after
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
for( int j = 0; j < options->count(); j++ ) {
QString option = colon_unescape( options->at(j) );
if( !option.isEmpty() ) {
- ppsz_options[j] = qtu(option);
+ ppsz_options[j] = strdup(qtu(option));
i_options++;
}
}
if( i_ret == VLC_SUCCESS && b_start && b_playlist )
RecentsMRL::getInstance( p_intf )->addRecent( mrl );
+ /* Free options */
+ if ( ppsz_options != NULL )
+ {
+ for ( int i = 0; i < i_options; ++i )
+ free( (char*)ppsz_options[i] );
+ delete[] ppsz_options;
+ }
return i_ret;
}
-