]> git.sesse.net Git - vlc/blobdiff - modules/audio_output/esd.c
Fix memleak in esp audio output.
[vlc] / modules / audio_output / esd.c
index 4d57ef0f94d457807457a75612a32563d69fbc45..b56b99cb9890facf6927a0e228a3700306096683 100644 (file)
@@ -31,7 +31,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_aout.h>
 
@@ -91,10 +91,7 @@ static int Open( vlc_object_t *p_this )
     /* Allocate structure */
     p_sys = malloc( sizeof( aout_sys_t ) );
     if( p_sys == NULL )
-    {
-        msg_Err( p_aout, "out of memory" );
         return VLC_ENOMEM;
-    }
 
     p_aout->output.p_sys = p_sys;
 
@@ -149,6 +146,7 @@ static int Open( vlc_object_t *p_this )
     {
         msg_Err( p_aout, "cannot open esound socket (format 0x%08x at %d Hz)",
                          p_sys->esd_format, p_aout->output.output.i_rate );
+        free( psz_server );
         free( p_sys );
         return VLC_EGENERIC;
     }
@@ -183,6 +181,7 @@ static int Open( vlc_object_t *p_this )
       / p_aout->output.output.i_bytes_per_frame
       / p_aout->output.output.i_rate;
 
+    free( psz_server );
     close( i_newfd );
     return VLC_SUCCESS;
 }