[vlc-devel] commit: Fix memory leak (CID 92) ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat May 31 22:20:11 CEST 2008


vlc | branch: 0.8.6-bugfix | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sat May 31 23:19:32 2008 +0300| [bd6877f9e3e0738013521bc98fe6bd12697a59ce]

Fix memory leak (CID 92)

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

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

diff --git a/src/control/mediacontrol_core.c b/src/control/mediacontrol_core.c
index 7e0e5b3..db04a05 100644
--- a/src/control/mediacontrol_core.c
+++ b/src/control/mediacontrol_core.c
@@ -118,7 +118,7 @@ mediacontrol_get_media_position( mediacontrol_Instance *self,
     if( ! p_input )
     {
         RAISE( mediacontrol_InternalException, "No input thread." );
-        return NULL;
+        goto error;
     }
 
     if(  an_origin != mediacontrol_AbsolutePosition )
@@ -126,7 +126,7 @@ mediacontrol_get_media_position( mediacontrol_Instance *self,
         /* Relative or ModuloPosition make no sense */
         RAISE( mediacontrol_PositionOriginNotSupported,
                                         "Only absolute position is valid." );
-        return NULL;
+        goto error;
     }
 
     /* We are asked for an AbsolutePosition. */
@@ -139,6 +139,9 @@ mediacontrol_get_media_position( mediacontrol_Instance *self,
                                                a_key,
                                                val.i_time / 1000 );
     return retval;
+error:
+    free( retval );
+    return NULL;
 }
 
 /* Sets the media position */




More information about the vlc-devel mailing list