]> git.sesse.net Git - vlc/commitdiff
Alloc memory later, remove non-compilable goto
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Wed, 15 Oct 2008 15:54:24 +0000 (18:54 +0300)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Wed, 15 Oct 2008 15:54:51 +0000 (18:54 +0300)
src/misc/messages.c

index a7c096da0cb656fa9953b9e0b3064fae6824410b..087d9cd9b770bfce0cec5d07d1cb636880912474 100644 (file)
@@ -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_header = NULL;
     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 ||
         (p_this->i_flags & OBJECT_FLAGS_NODBG && i_type == VLC_MSG_DBG) )
-        goto out;
+        return;
 
 #ifndef __GLIBC__
     /* 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,
         va_end( args );
         fputs( "\n", stderr );
         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;
     p_obj = p_this;
     while( p_obj != NULL )
@@ -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_mutex_unlock (&bank->lock);
-out:
     msg_Release (p_item);
 }