[vlc-commits] commit: shout: fix a memory leak. ( Rémi Duraffort )

git at videolan.org git at videolan.org
Sat Oct 23 15:48:02 CEST 2010


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sat Oct 23 15:46:58 2010 +0200| [9076372339058bf8447ce5edfbf8f098aa298d63] | committer: Rémi Duraffort 

shout: fix a memory leak.

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

 modules/access_output/shout.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/access_output/shout.c b/modules/access_output/shout.c
index e8d992e..1c0579b 100644
--- a/modules/access_output/shout.c
+++ b/modules/access_output/shout.c
@@ -218,13 +218,12 @@ static int Open( vlc_object_t *p_this )
     {
         msg_Err( p_access, "failed to initialize shout streaming to %s:%i/%s",
                  url.psz_host, url.i_port, url.psz_path );
-        free( p_access->p_sys );
+
         free( psz_name );
         free( psz_description );
         free( psz_genre );
         free( psz_url );
-        vlc_UrlClean( &url );
-        return VLC_EGENERIC;
+        goto error;
     }
 
     free( psz_name );
@@ -397,6 +396,8 @@ static int Open( vlc_object_t *p_this )
     return VLC_SUCCESS;
 
 error:
+    if( p_sys->p_shout )
+        shout_free( p_sys->p_shout );
     vlc_UrlClean( &url );
     free( p_sys );
     return VLC_EGENERIC;
@@ -413,6 +414,7 @@ static void Close( vlc_object_t * p_this )
     if( p_sys->p_shout )
     {
         shout_close( p_sys->p_shout );
+        shout_free( p_sys->p_shout );
         shout_shutdown();
     }
     free( p_sys );



More information about the vlc-commits mailing list