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

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


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

Fix memory leak (CID 91)

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

 src/control/core.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/control/core.c b/src/control/core.c
index db62ce0..b0590ba 100644
--- a/src/control/core.c
+++ b/src/control/core.c
@@ -105,7 +105,11 @@ libvlc_instance_t * libvlc_new( int argc, char **argv,
                                 VLC_OBJECT_PLAYLIST, FIND_CHILD );
     p_new->p_vlm = NULL;
 
-    if( !p_new->p_playlist ) RAISENULL( "Playlist creation failed" );
+    if( !p_new->p_playlist )
+    {
+        libvlc_destroy( p_new );
+        RAISENULL( "Playlist creation failed" );
+    }
 
     p_new->i_vlc_id = i_vlc_id;
     return p_new;




More information about the vlc-devel mailing list