[metacity] Make sure to always call va_end
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] Make sure to always call va_end
- Date: Sun, 28 Sep 2014 16:03:00 +0000 (UTC)
commit b235d3e78670e30a55f3f746f13003577988bed6
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 68ba70a..cf95259 100644
--- a/src/core/core.c
+++ b/src/core/core.c
@@ -87,7 +87,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) {
@@ -97,7 +97,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;
@@ -212,6 +212,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 c7684c8..9deecd2 100644
--- a/src/ui/theme-parser.c
+++ b/src/ui/theme-parser.c
@@ -444,7 +444,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]