Commit a81102ef authored by Rémi Duraffort's avatar Rémi Duraffort

Fix "use after a free" (to be honnest that's more a segfault here) (CID 243)

parent d12f65f6
......@@ -143,14 +143,14 @@ static xml_reader_t *ReaderCreate( xml_t *p_xml, stream_t *p_stream )
p_reader = malloc( sizeof(xml_reader_t) );
if( !p_reader )
{
xmlFreeTextReader( p_reader->p_sys->p_reader );
xmlFreeTextReader( p_libxml_reader );
return NULL;
}
p_reader->p_sys = p_sys = malloc( sizeof(xml_reader_sys_t) );
if( !p_sys )
{
xmlFreeTextReader( p_libxml_reader );
free( p_reader );
xmlFreeTextReader( p_reader->p_sys->p_reader );
return NULL;
}
p_reader->p_sys->p_reader = p_libxml_reader;
......
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