summaryrefslogtreecommitdiff
path: root/tests/test-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-common.c')
-rw-r--r--tests/test-common.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/test-common.c b/tests/test-common.c
index 786973f1..60ecb7e1 100644
--- a/tests/test-common.c
+++ b/tests/test-common.c
@@ -125,14 +125,22 @@ print_attribute (PangoAttribute *attr, GString *string)
g_string_append_printf (string, "%d", ((PangoAttrInt *)attr)->value);
break;
case PANGO_ATTR_FONT_DESC:
- g_string_append_printf (string, "%s", pango_font_description_to_string (((PangoAttrFontDesc *)attr)->desc));
+ {
+ char *text = pango_font_description_to_string (((PangoAttrFontDesc *)attr)->desc);
+ g_string_append_printf (string, "%s", text);
+ g_free (text);
+ }
break;
case PANGO_ATTR_FOREGROUND:
case PANGO_ATTR_BACKGROUND:
case PANGO_ATTR_UNDERLINE_COLOR:
case PANGO_ATTR_OVERLINE_COLOR:
case PANGO_ATTR_STRIKETHROUGH_COLOR:
- g_string_append_printf (string, "%s", pango_color_to_string (&((PangoAttrColor *)attr)->color));
+ {
+ char *text = pango_color_to_string (&((PangoAttrColor *)attr)->color);
+ g_string_append_printf (string, "%s", text);
+ g_free (text);
+ }
break;
case PANGO_ATTR_SHAPE:
g_string_append_printf (string, "shape");