[vlc-devel] commit: Cleaning (potential memleak and uneeded message). ( Rémi Duraffort )

git version control git at videolan.org
Tue Oct 14 20:47:26 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Tue Oct 14 20:38:30 2008 +0200| [00d63f8fa96376ac8f2bdee549d1360b4a34e945] | committer: Rémi Duraffort 

Cleaning (potential memleak and uneeded message).

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

 modules/misc/dummy/decoder.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/misc/dummy/decoder.c b/modules/misc/dummy/decoder.c
index 4b96808..6f09676 100644
--- a/modules/misc/dummy/decoder.c
+++ b/modules/misc/dummy/decoder.c
@@ -78,8 +78,7 @@ static int OpenDecoderCommon( vlc_object_t *p_this, bool b_force_dump )
     if( ( p_dec->p_sys = p_sys =
           (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
     {
-        msg_Err( p_dec, "out of memory" );
-        return VLC_EGENERIC;
+        return VLC_ENOMEM;
     }
 
     snprintf( psz_file, sizeof( psz_file), "stream.%p", p_dec );
@@ -98,6 +97,7 @@ static int OpenDecoderCommon( vlc_object_t *p_this, bool b_force_dump )
         if( p_sys->i_fd == -1 )
         {
             msg_Err( p_dec, "cannot create `%s'", psz_file );
+            free( p_sys );
             return VLC_EGENERIC;
         }
 
@@ -164,8 +164,10 @@ void CloseDecoder ( vlc_object_t *p_this )
     decoder_sys_t *p_sys = p_dec->p_sys;
 
 #ifndef UNDER_CE
-    if( p_sys->i_fd >= 0 ) close( p_sys->i_fd );
+    if( p_sys->i_fd >= 0 )
+        close( p_sys->i_fd );
 #endif
 
     free( p_sys );
 }
+




More information about the vlc-devel mailing list