]> git.sesse.net Git - vlc/commitdiff
libvlc: destroy the intf variable only if created just before.
authorRémi Duraffort <ivoire@videolan.org>
Wed, 23 Dec 2009 12:30:11 +0000 (13:30 +0100)
committerRémi Duraffort <ivoire@videolan.org>
Mon, 28 Dec 2009 13:18:28 +0000 (14:18 +0100)
src/libvlc.c

index c3087573effd011e093f40c29cfd77f338dd53a8..b39fbf2af609100837c11246f2249fcf0b2adcb6 100644 (file)
@@ -1171,6 +1171,7 @@ int libvlc_InternalAddIntf( libvlc_int_t *p_libvlc, char const *psz_module )
                             "Use 'cvlc' to use vlc without interface.") );
         }
         free( psz_interface );
+        var_Destroy( p_libvlc, "intf" );
     }
 
     /* Try to create the interface */
@@ -1178,7 +1179,6 @@ int libvlc_InternalAddIntf( libvlc_int_t *p_libvlc, char const *psz_module )
     if( ret )
         msg_Err( p_libvlc, "interface \"%s\" initialization failed",
                  psz_module ? psz_module : "default" );
-    var_Destroy( p_libvlc, "intf" );
     return ret;
 }