Simplify
authorRémi Denis-Courmont <remi@remlab.net>
Sat, 22 Jan 2011 08:28:42 +0000 (10:28 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 22 Jan 2011 08:28:42 +0000 (10:28 +0200)
modules/misc/xml/libxml.c

index 7cd55a4..4fd6869 100644 (file)
@@ -145,6 +145,9 @@ struct xml_reader_sys_t
 
 static int ReaderOpen( vlc_object_t *p_this )
 {
+    if( !xmlHasFeature( XML_WITH_THREAD ) )
+        return VLC_EGENERIC;
+
     xml_reader_t *p_reader = (xml_reader_t *)p_this;
     xml_reader_sys_t *p_sys = malloc( sizeof( *p_sys ) );
     xmlTextReaderPtr p_libxml_reader;
@@ -152,12 +155,6 @@ static int ReaderOpen( vlc_object_t *p_this )
     if( unlikely(!p_sys) )
         return VLC_ENOMEM;
 
-    if( !xmlHasFeature( XML_WITH_THREAD ) )
-    {
-        free( p_sys );
-        return VLC_EGENERIC;
-    }
-
     vlc_mutex_lock( &lock );
     xmlInitParser();
     vlc_mutex_unlock( &lock );