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

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

(cherry picked from commit a81102ef)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent fbd67aeb
...@@ -143,14 +143,14 @@ static xml_reader_t *ReaderCreate( xml_t *p_xml, stream_t *p_stream ) ...@@ -143,14 +143,14 @@ static xml_reader_t *ReaderCreate( xml_t *p_xml, stream_t *p_stream )
p_reader = malloc( sizeof(xml_reader_t) ); p_reader = malloc( sizeof(xml_reader_t) );
if( !p_reader ) if( !p_reader )
{ {
xmlFreeTextReader( p_reader->p_sys->p_reader ); xmlFreeTextReader( p_libxml_reader );
return NULL; return NULL;
} }
p_reader->p_sys = p_sys = malloc( sizeof(xml_reader_sys_t) ); p_reader->p_sys = p_sys = malloc( sizeof(xml_reader_sys_t) );
if( !p_sys ) if( !p_sys )
{ {
xmlFreeTextReader( p_libxml_reader );
free( p_reader ); free( p_reader );
xmlFreeTextReader( p_reader->p_sys->p_reader );
return NULL; return NULL;
} }
p_reader->p_sys->p_reader = p_libxml_reader; 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