[glib] Fix cleanup in g_markup_collect
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Fix cleanup in g_markup_collect
- Date: Fri, 11 Mar 2011 04:28:33 +0000 (UTC)
commit a6615ba859e8723888e108e2af390e5645dfa761
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Mar 10 23:27:49 2011 -0500
Fix cleanup in g_markup_collect
Patch by Matt Barnes,
https://bugzilla.gnome.org/show_bug.cgi?id=644428
glib/gmarkup.c | 35 ++++++++++++++++-------------------
1 files changed, 16 insertions(+), 19 deletions(-)
---
diff --git a/glib/gmarkup.c b/glib/gmarkup.c
index ccdb500..609b88d 100644
--- a/glib/gmarkup.c
+++ b/glib/gmarkup.c
@@ -2794,33 +2794,30 @@ failure:
ptr = va_arg (ap, gpointer);
- if (ptr == NULL)
- continue;
-
- switch (type & (G_MARKUP_COLLECT_OPTIONAL - 1))
+ if (ptr != NULL)
{
- case G_MARKUP_COLLECT_STRDUP:
- if (written)
- g_free (*(char **) ptr);
+ switch (type & (G_MARKUP_COLLECT_OPTIONAL - 1))
+ {
+ case G_MARKUP_COLLECT_STRDUP:
+ if (written)
+ g_free (*(char **) ptr);
- case G_MARKUP_COLLECT_STRING:
- *(char **) ptr = NULL;
- break;
+ case G_MARKUP_COLLECT_STRING:
+ *(char **) ptr = NULL;
+ break;
- case G_MARKUP_COLLECT_BOOLEAN:
- *(gboolean *) ptr = FALSE;
- break;
+ case G_MARKUP_COLLECT_BOOLEAN:
+ *(gboolean *) ptr = FALSE;
+ break;
- case G_MARKUP_COLLECT_TRISTATE:
- *(gboolean *) ptr = -1;
- break;
+ case G_MARKUP_COLLECT_TRISTATE:
+ *(gboolean *) ptr = -1;
+ break;
+ }
}
type = va_arg (ap, GMarkupCollectType);
attr = va_arg (ap, const char *);
-
- if (written)
- written--;
}
va_end (ap);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]