[mutter] Make sure to always call va_end



commit bdbb852163dbf51cbc6898252b8370066bf0a053
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Sep 3 16:04:22 2013 -0400

    Make sure to always call va_end

 src/core/core.c       |    5 +++--
 src/ui/theme-parser.c |    6 +++++-
 2 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/core/core.c b/src/core/core.c
index 7583da1..1b2a9a9 100644
--- a/src/core/core.c
+++ b/src/core/core.c
@@ -89,7 +89,7 @@ meta_core_get (Display *xdisplay,
   if (request != META_CORE_WINDOW_HAS_FRAME &&
       (window == NULL || window->frame == NULL)) {
     meta_bug ("No such frame window 0x%lx!\n", xwindow);
-    return;
+    goto out;
   }
 
   while (request != META_CORE_GET_END) {
@@ -99,7 +99,7 @@ meta_core_get (Display *xdisplay,
     switch (request) {
       case META_CORE_WINDOW_HAS_FRAME:
         *((gboolean*)answer) = window != NULL && window->frame != NULL;
-        if (!*((gboolean*)answer)) return; /* see above */
+        if (!*((gboolean*)answer)) goto out; /* see above */
         break; 
       case META_CORE_GET_CLIENT_WIDTH:
         *((gint*)answer) = window->rect.width;
@@ -160,6 +160,7 @@ meta_core_get (Display *xdisplay,
     request = va_arg (args, MetaCoreGetType);
   } 
 
+ out:
   va_end (args);
 }
 
diff --git a/src/ui/theme-parser.c b/src/ui/theme-parser.c
index cd8baec..0e93aef 100644
--- a/src/ui/theme-parser.c
+++ b/src/ui/theme-parser.c
@@ -430,7 +430,11 @@ locate_attributes (GMarkupParseContext *context,
 
   while (name != NULL)
     {
-      g_return_val_if_fail (retloc != NULL, FALSE);
+      if (retloc == NULL)
+        {
+          retval = FALSE;
+          goto out;
+        }
 
       g_assert (n_attrs < MAX_ATTRS);
       


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]