[vlc-devel] commit: Fix "use after a free" (to be honnest that's more a segfault here) (CID 243) ( Rémi Duraffort )

git version control git at videolan.org
Wed Oct 1 20:22:37 CEST 2008


vlc | branch: 0.9-bugfix | Rémi Duraffort <ivoire at videolan.org> | Wed Oct  1 20:11:56 2008 +0200| [d0ae8792e64e79d116b4e96068c3551e6517f07f] | committer: Jean-Baptiste Kempf 

Fix "use after a free" (to be honnest that's more a segfault here) (CID 243)
(cherry picked from commit a81102ef9913dcb5f74b58aee09add9228eba3fb)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d0ae8792e64e79d116b4e96068c3551e6517f07f
---

 modules/misc/xml/libxml.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/misc/xml/libxml.c b/modules/misc/xml/libxml.c
index cc46ab4..1b25a82 100644
--- a/modules/misc/xml/libxml.c
+++ b/modules/misc/xml/libxml.c
@@ -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;




More information about the vlc-devel mailing list