Commit 31a16394 authored by ivoire's avatar ivoire
Browse files

vcdx: Fix memleaks.

parent 75a1834d
...@@ -651,6 +651,7 @@ VCDParse( access_t * p_access, /*out*/ vcdinfo_itemid_t * p_itemid, ...@@ -651,6 +651,7 @@ VCDParse( access_t * p_access, /*out*/ vcdinfo_itemid_t * p_itemid,
psz_source = config_GetPsz( p_access, "vcd" ); psz_source = config_GetPsz( p_access, "vcd" );
if( !psz_source || 0==strlen(psz_source) ) { if( !psz_source || 0==strlen(psz_source) ) {
free( psz_source );
/* Scan for a CD-ROM drive with a VCD in it. */ /* Scan for a CD-ROM drive with a VCD in it. */
char **cd_drives = cdio_get_devices_with_cap( NULL, char **cd_drives = cdio_get_devices_with_cap( NULL,
( CDIO_FS_ANAL_SVCD | CDIO_FS_ANAL_CVD ( CDIO_FS_ANAL_SVCD | CDIO_FS_ANAL_CVD
......
...@@ -175,10 +175,11 @@ VCDMetaInfo( access_t *p_access, /*const*/ char *psz_mrl ) ...@@ -175,10 +175,11 @@ VCDMetaInfo( access_t *p_access, /*const*/ char *psz_mrl )
if ( CDIO_INVALID_TRACK != i_track ) if ( CDIO_INVALID_TRACK != i_track )
{ {
char* psz_title_format = config_GetPsz( p_access, MODULE_STRING "-title-format" );
char *psz_name = char *psz_name =
VCDFormatStr( p_access, p_vcdplayer, VCDFormatStr( p_access, p_vcdplayer, psz_title_format, psz_mrl,
config_GetPsz( p_access, MODULE_STRING "-title-format" ), &(p_vcdplayer->play_item) );
psz_mrl, &(p_vcdplayer->play_item) ); free( psz_title_format );
input_Control( p_vcdplayer->p_input, INPUT_SET_NAME, psz_name ); input_Control( p_vcdplayer->p_input, INPUT_SET_NAME, psz_name );
} }
...@@ -385,14 +386,14 @@ VCDUpdateTitle( access_t *p_access ) ...@@ -385,14 +386,14 @@ VCDUpdateTitle( access_t *p_access )
if( psz_mrl ) if( psz_mrl )
{ {
char *psz_name; char *psz_name;
snprintf(psz_mrl, psz_mrl_max, "%s%s", char* psz_title_format = config_GetPsz( p_access, MODULE_STRING "-title-format" )
VCD_MRL_PREFIX, p_vcdplayer->psz_source); snprintf( psz_mrl, psz_mrl_max, "%s%s",
psz_name = VCDFormatStr( p_access, p_vcdplayer, VCD_MRL_PREFIX, p_vcdplayer->psz_source );
config_GetPsz( p_access, MODULE_STRING psz_name = VCDFormatStr( p_access, p_vcdplayer, psz_title_format, psz_mrl,
"-title-format" ), &(p_vcdplayer->play_item) );
psz_mrl, &(p_vcdplayer->play_item) ); input_Control( p_vcdplayer->p_input, INPUT_SET_NAME, psz_name );
input_Control( p_vcdplayer->p_input, INPUT_SET_NAME, psz_name ); free( psz_title_format );
free(psz_mrl); free(psz_mrl);
} }
} }
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