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

Tristan Matthews le.businessman at gmail.com
Fri Dec 13 21:27:05 CET 2013


---
 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,
-- 
1.8.3.1




More information about the vlc-devel mailing list