Commit cf08617d authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Alloc memory later, remove non-compilable goto

parent 3e1abbd7
...@@ -330,17 +330,10 @@ static void QueueMsg( vlc_object_t *p_this, int i_type, const char *psz_module, ...@@ -330,17 +330,10 @@ static void QueueMsg( vlc_object_t *p_this, int i_type, const char *psz_module,
char * psz_str = NULL; /* formatted message string */ char * psz_str = NULL; /* formatted message string */
char * psz_header = NULL; char * psz_header = NULL;
va_list args; va_list args;
msg_item_t * p_item = malloc (sizeof (*p_item));
if (p_item == NULL)
return; /* Uho! */
vlc_gc_init (p_item, msg_Free);
p_item->psz_module = p_item->psz_msg = p_item->psz_header = NULL;
if( p_this->i_flags & OBJECT_FLAGS_QUIET || if( p_this->i_flags & OBJECT_FLAGS_QUIET ||
(p_this->i_flags & OBJECT_FLAGS_NODBG && i_type == VLC_MSG_DBG) ) (p_this->i_flags & OBJECT_FLAGS_NODBG && i_type == VLC_MSG_DBG) )
goto out; return;
#ifndef __GLIBC__ #ifndef __GLIBC__
/* Expand %m to strerror(errno) - only once */ /* Expand %m to strerror(errno) - only once */
...@@ -427,9 +420,19 @@ static void QueueMsg( vlc_object_t *p_this, int i_type, const char *psz_module, ...@@ -427,9 +420,19 @@ static void QueueMsg( vlc_object_t *p_this, int i_type, const char *psz_module,
va_end( args ); va_end( args );
fputs( "\n", stderr ); fputs( "\n", stderr );
vlc_restorecancel (canc); vlc_restorecancel (canc);
goto out; return;
} }
msg_item_t * p_item = malloc (sizeof (*p_item));
if (p_item == NULL)
return; /* Uho! */
vlc_gc_init (p_item, msg_Free);
p_item->psz_module = p_item->psz_msg = p_item->psz_header = NULL;
i_header_size = 0; i_header_size = 0;
p_obj = p_this; p_obj = p_this;
while( p_obj != NULL ) while( p_obj != NULL )
...@@ -483,7 +486,6 @@ static void QueueMsg( vlc_object_t *p_this, int i_type, const char *psz_module, ...@@ -483,7 +486,6 @@ static void QueueMsg( vlc_object_t *p_this, int i_type, const char *psz_module,
} }
vlc_cond_broadcast (&bank->wait); vlc_cond_broadcast (&bank->wait);
vlc_mutex_unlock (&bank->lock); vlc_mutex_unlock (&bank->lock);
out:
msg_Release (p_item); msg_Release (p_item);
} }
......
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