[vlc-devel] commit: Memory leak (fix #2448) ( Rémi Denis-Courmont )

git version control git at videolan.org
Mon Jan 26 20:56:40 CET 2009


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Mon Jan 26 21:55:36 2009 +0200| [c4f8422a864451f06c257daf4a678f44f5a45410] | committer: Rémi Denis-Courmont 

Memory leak (fix #2448)

N.B.: I hate branching macros for a reason

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

 src/control/mediacontrol_core.c |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/control/mediacontrol_core.c b/src/control/mediacontrol_core.c
index 67a4cbe..240c93f 100644
--- a/src/control/mediacontrol_core.c
+++ b/src/control/mediacontrol_core.c
@@ -346,7 +346,15 @@ mediacontrol_get_stream_information( mediacontrol_Instance *self,
     }
 
     p_media = libvlc_media_player_get_media( self->p_media_player, &ex );
-    HANDLE_LIBVLC_EXCEPTION_NULL( &ex );
+    if( libvlc_exception_raised( &ex ) )
+    {
+        free( retval );
+        RAISE( mediacontrol_InternalException,
+               libvlc_exception_get_message( &ex ) );
+        libvlc_exception_clear( &ex );
+        return NULL;
+    }
+
     if( ! p_media )
     {
         /* No p_media defined */
@@ -358,8 +366,17 @@ mediacontrol_get_stream_information( mediacontrol_Instance *self,
     else
     {
         libvlc_state_t state;
+
         state = libvlc_media_player_get_state( self->p_media_player, &ex );
-        HANDLE_LIBVLC_EXCEPTION_NULL( &ex );
+        if( libvlc_exception_raised( &ex ) )
+        {
+            free( retval );
+            RAISE( mediacontrol_InternalException,
+                   libvlc_exception_get_message( &ex ) );
+            libvlc_exception_clear( &ex );
+            return NULL;
+        }
+
         switch( state )
         {
         case libvlc_NothingSpecial:




More information about the vlc-devel mailing list