summaryrefslogtreecommitdiff
path: root/pango/pango-markup.c
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@codefactory.se>2001-04-20 10:03:28 +0000
committerAnders Carlsson <andersca@src.gnome.org>2001-04-20 10:03:28 +0000
commit8d3c9f220c260bd09e03126f924fc6fb58e8c9c5 (patch)
tree25d43b6f0ef7bb2dae320f3765d3e51596e75de0 /pango/pango-markup.c
parent5ddbcc1b9efc2153d49547bc371f411c3c266a20 (diff)
downloadpango-8d3c9f220c260bd09e03126f924fc6fb58e8c9c5.tar.gz
Discard the parsed text if the input variable text is NULL. This fixes a
2001-04-20 Anders Carlsson <andersca@codefactory.se> * pango/pango-markup.c (pango_parse_markup): Discard the parsed text if the input variable text is NULL. This fixes a segfault.
Diffstat (limited to 'pango/pango-markup.c')
-rw-r--r--pango/pango-markup.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/pango/pango-markup.c b/pango/pango-markup.c
index b6cbe2e7..97fb421a 100644
--- a/pango/pango-markup.c
+++ b/pango/pango-markup.c
@@ -601,8 +601,7 @@ pango_parse_markup (const char *markup_text,
if (attr_list)
md->attr_list = pango_attr_list_new ();
- if (text)
- md->text = g_string_new ("");
+ md->text = g_string_new ("");
if (accel_char)
*accel_char = 0;
@@ -678,7 +677,9 @@ pango_parse_markup (const char *markup_text,
if (text)
*text = g_string_free (md->text, FALSE);
-
+ else
+ g_string_free (md->text, TRUE);
+
if (accel_char)
*accel_char = md->accel_char;