[vlc-devel] commit: Memory leak (CID #66) ( Rémi Denis-Courmont )

git version control git at videolan.org
Tue Jul 1 21:31:50 CEST 2008


vlc | branch: 0.8.6-bugfix | Rémi Denis-Courmont <rdenis at simphalempin.com> | Tue Jul  1 22:33:32 2008 +0300| [cd6310b95b79add5a57e1cbe909367cec3bcf7e6]

Memory leak (CID #66)

(N/A for master)

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

 src/misc/messages.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/misc/messages.c b/src/misc/messages.c
index 02edea8..31d4d4e 100644
--- a/src/misc/messages.c
+++ b/src/misc/messages.c
@@ -4,7 +4,7 @@
  * modules, especially intf modules. See config.h for output configuration.
  *****************************************************************************
  * Copyright (C) 1998-2005 the VideoLAN team
- * $Id$
+ * $Id: 02edea820b684242846d5da7b08d16b12d7a2d14 $
  *
  * Authors: Vincent Seguin <seguin at via.ecp.fr>
  *          Samuel Hocevar <sam at zoy.org>
@@ -162,7 +162,7 @@ void __msg_Destroy( vlc_object_t *p_this )
 msg_subscription_t *__msg_Subscribe( vlc_object_t *p_this, int i_queue )
 {
     msg_bank_t *p_bank = &p_this->p_libvlc->msg_bank;
-    msg_subscription_t *p_sub = malloc( sizeof( msg_subscription_t ) );
+    msg_subscription_t *p_sub;
     msg_queue_t *p_queue = NULL;
     int i;
 
@@ -184,6 +184,8 @@ msg_subscription_t *__msg_Subscribe( vlc_object_t *p_this, int i_queue )
 
     vlc_mutex_lock( &p_queue->lock );
 
+    p_sub = malloc( sizeof( msg_subscription_t ) );
+
     /* Add subscription to the list */
     INSERT_ELEM( p_bank->pp_queues[i_queue]->pp_sub,
                  p_bank->pp_queues[i_queue]->i_sub,




More information about the vlc-devel mailing list