Commit 28e2485a authored by Jean-Paul Saman's avatar Jean-Paul Saman

sanity checking

parent eeca6121
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* This library provides an interface to the message queue to be used by other * This library provides an interface to the message queue to be used by other
* modules, especially intf modules. See config.h for output configuration. * modules, especially intf modules. See config.h for output configuration.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2004 the VideoLAN team * Copyright (C) 1998-2005 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
...@@ -209,8 +209,7 @@ void __msg_Unsubscribe( vlc_object_t *p_this, msg_subscription_t *p_sub ) ...@@ -209,8 +209,7 @@ void __msg_Unsubscribe( vlc_object_t *p_this, msg_subscription_t *p_sub )
/* Remove this subscription */ /* Remove this subscription */
REMOVE_ELEM( p_bank->pp_sub, p_bank->i_sub, i_index ); REMOVE_ELEM( p_bank->pp_sub, p_bank->i_sub, i_index );
free( p_sub ); if( p_sub ) free( p_sub );
vlc_mutex_unlock( &p_bank->lock ); vlc_mutex_unlock( &p_bank->lock );
} }
...@@ -377,7 +376,9 @@ static void QueueMsg( vlc_object_t *p_this, int i_type, const char *psz_module, ...@@ -377,7 +376,9 @@ static void QueueMsg( vlc_object_t *p_this, int i_type, const char *psz_module,
if( p_bank->b_overflow ) if( p_bank->b_overflow )
{ {
if( p_item->psz_module )
free( p_item->psz_module ); free( p_item->psz_module );
if( p_item->psz_msg )
free( p_item->psz_msg ); free( p_item->psz_msg );
} }
...@@ -426,7 +427,9 @@ static void FlushMsg ( msg_bank_t *p_bank ) ...@@ -426,7 +427,9 @@ static void FlushMsg ( msg_bank_t *p_bank )
i_index != i_stop; i_index != i_stop;
i_index = (i_index+1) % VLC_MSG_QSIZE ) i_index = (i_index+1) % VLC_MSG_QSIZE )
{ {
if( p_bank->msg[i_index].psz_msg )
free( p_bank->msg[i_index].psz_msg ); free( p_bank->msg[i_index].psz_msg );
if( p_bank->msg[i_index].psz_module )
free( p_bank->msg[i_index].psz_module ); free( p_bank->msg[i_index].psz_module );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment