[vlc-commits] libvlc: don't use string after free

Tristan Matthews git at videolan.org
Fri Dec 13 22:59:24 CET 2013


vlc | branch: master | Tristan Matthews <le.businessman at gmail.com> | Fri Dec 13 15:24:57 2013 -0500| [eea56f0401fb40f1aeeb58b841e27bb541c9bc38] | committer: Tristan Matthews

libvlc: don't use string after free

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

 src/libvlc.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/libvlc.c b/src/libvlc.c
index ead3a0d..606d8ed 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -328,12 +328,12 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
             {
                  dbus_message_unref( msg );
                  msg = NULL;
+                 free( mrl );
+                 continue;
             }
-            free( mrl );
-            if( unlikely(msg == NULL) )
-                continue;
 
             msg_Dbg( p_libvlc, "Adds %s to the running media player", mrl );
+            free( mrl );
 
             /* send message and get a handle for a reply */
             DBusMessage *reply = dbus_connection_send_with_reply_and_block( conn, msg, -1,



More information about the vlc-commits mailing list