Make sure to always call va_end

This commit is contained in:
Jasper St. Pierre 2013-09-03 16:04:22 -04:00
parent 4a11f126cd
commit bdbb852163
2 changed files with 8 additions and 3 deletions

View File

@ -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);
}

View File

@ -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);