Commit 77950f05 authored by Rémi Duraffort's avatar Rémi Duraffort

Cleanup and fix a potential memleak.

parent 0237be20
......@@ -553,18 +553,22 @@ static bool parse_track_node COMPLEX_INTERFACE
}
psz_uri = decode_URI_duplicate( psz_value );
if( psz_uri )
if( !psz_uri )
{
if( p_demux->p_sys->psz_base &&
!strstr( psz_uri, "://" ) )
{
char* psz_tmp = malloc(
strlen(p_demux->p_sys->psz_base) +
strlen(psz_uri) +1 );
if( !psz_tmp )
FREE_ATT();
return false;
sprintf( psz_tmp, "%s%s",
p_demux->p_sys->psz_base, psz_uri );
}
if( p_demux->p_sys->psz_base && !strstr( psz_uri, "://" ) )
{
char* psz_tmp;
if( asprintf( &psz_tmp, "%s%s", p_demux->p_sys->psz_base,
psz_uri ) == -1 )
{
free( psz_uri );
FREE_ATT();
return NULL;
}
free( psz_uri );
psz_uri = psz_tmp;
}
......@@ -577,12 +581,6 @@ static bool parse_track_node COMPLEX_INTERFACE
p_handler = NULL;
}
else
{
FREE_ATT();
return false;
}
}
else
{
/* there MUST be an item */
if( !p_new_input )
......
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