]> git.sesse.net Git - vlc/blobdiff - modules/misc/notify/xosd.c
notify/xosd: potential memleaks
[vlc] / modules / misc / notify / xosd.c
index dd5dbc6888fb5ce676c96ef106883530a360d728..4e8fe32125cf84a2c18ae5e3ae2201b5fdb50e17 100644 (file)
@@ -113,14 +113,12 @@ static int Open( vlc_object_t *p_this )
     /* Allocate instance and initialize some members */
     p_intf->p_sys = (intf_sys_t *)malloc( sizeof( intf_sys_t ) );
     if( p_intf->p_sys == NULL )
-    {
-        msg_Err( p_intf, "out of memory" );
         return VLC_ENOMEM;
-    }
 
     if( getenv( "DISPLAY" ) == NULL )
     {
         msg_Err( p_intf, "no display, please set the DISPLAY variable" );
+        free( p_sys );
         return VLC_EGENERIC;
     }
 
@@ -136,6 +134,7 @@ static int Open( vlc_object_t *p_this )
     if( p_intf->p_sys->p_osd == NULL )
     {
         msg_Err( p_intf, "couldn't initialize libxosd" );
+        free( p_sys );
         return VLC_EGENERIC;
     }
 #else
@@ -143,6 +142,7 @@ static int Open( vlc_object_t *p_this )
     if( p_osd == NULL )
     {
         msg_Err( p_intf, "couldn't initialize libxosd" );
+        free( p_sys );
         return VLC_EGENERIC;
     }