summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSzunti <Szunti@users.noreply.github.com>2020-12-27 00:44:14 +0100
committerSzunti <Szunti@users.noreply.github.com>2021-01-16 16:07:19 +0100
commit7555012e7dbba9f3d6ecede432126508fbf0582f (patch)
tree51af13fb9dead388dd4d959c973aaf5cc3e811e2 /tests
parentfb7eda6ed6ca6f8c6f8e4140374c5e980c00e5aa (diff)
downloadpango-7555012e7dbba9f3d6ecede432126508fbf0582f.tar.gz
Fix leaks found by asan
Diffstat (limited to 'tests')
-rw-r--r--tests/test-font.c5
-rw-r--r--tests/test-itemize.c1
-rw-r--r--tests/test-shape.c5
-rw-r--r--tests/testboundaries_ucd.c1
4 files changed, 10 insertions, 2 deletions
diff --git a/tests/test-font.c b/tests/test-font.c
index 486504f9..d02c7932 100644
--- a/tests/test-font.c
+++ b/tests/test-font.c
@@ -164,9 +164,12 @@ test_extents (void)
PangoGlyphString *glyphs;
PangoRectangle ink, log;
PangoContext *context;
+ PangoFontDescription *desc;
context = pango_font_map_create_context (pango_cairo_font_map_get_default ());
- pango_context_set_font_description (context, pango_font_description_from_string ("Cantarell 11"));
+ desc = pango_font_description_from_string("Cantarell 11");
+ pango_context_set_font_description (context, desc);
+ pango_font_description_free (desc);
items = pango_itemize (context, str, 0, strlen (str), NULL, NULL);
glyphs = pango_glyph_string_new ();
diff --git a/tests/test-itemize.c b/tests/test-itemize.c
index dbe67e64..d1447a0f 100644
--- a/tests/test-itemize.c
+++ b/tests/test-itemize.c
@@ -279,6 +279,7 @@ test_itemize (gconstpointer d)
g_free (diff);
g_string_free (dump, TRUE);
g_free (expected_file);
+ g_object_unref (context);
}
int
diff --git a/tests/test-shape.c b/tests/test-shape.c
index 043f3d31..079bcd28 100644
--- a/tests/test-shape.c
+++ b/tests/test-shape.c
@@ -361,7 +361,10 @@ main (int argc, char *argv[])
g_free (path);
if (g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
- return 0;
+ {
+ g_error_free(error);
+ return 0;
+ }
g_assert_no_error (error);
while ((name = g_dir_read_name (dir)) != NULL)
diff --git a/tests/testboundaries_ucd.c b/tests/testboundaries_ucd.c
index 18ab94cc..0cd301f7 100644
--- a/tests/testboundaries_ucd.c
+++ b/tests/testboundaries_ucd.c
@@ -233,6 +233,7 @@ do_test (const gchar *filename,
if (g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
{
g_test_skip ("Test file not found");
+ g_error_free (error);
return;
}