Commit 11c5146b authored by Rémi Duraffort's avatar Rémi Duraffort Committed by Jean-Baptiste Kempf

http: fix memory leak in the error path

(cherry picked from commit 69ee998d3c9fe363b1af52ba3ee20fcd2c0a8b0f)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent ea52eae0
......@@ -917,13 +917,11 @@ static int ReadICYMeta( access_t *p_access )
for( i_read = 0; i_read < i_size; )
{
int i_tmp;
if( ReadData( p_access, &i_tmp, (uint8_t *)&psz_meta[i_read], i_size - i_read ) )
if( ReadData( p_access, &i_tmp, (uint8_t *)&psz_meta[i_read], i_size - i_read ) || i_tmp <= 0 )
{
free( psz_meta );
return VLC_EGENERIC;
}
if( i_tmp <= 0 )
return VLC_EGENERIC;
i_read += i_tmp;
}
psz_meta[i_read] = '\0'; /* Just in case */
......
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