summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Canciani <ranma42@gmail.com>2014-11-20 17:22:31 +0100
committerBryce Harrington <bryce@osg.samsung.com>2014-12-06 17:38:02 -0800
commit9806f437b42056124314976f35a2d32cefa508a8 (patch)
tree247d4c5c9a805574c11633889e666377eec888e9
parent40201f4b1ab52c85922b2b7ae05dd862159a1aa0 (diff)
downloadcairo-9806f437b42056124314976f35a2d32cefa508a8.tar.gz
test: Release owned pattern
The pattern created by cairo_pattern_create_rgb() is owned by the caller, hence it needs to be released. Fixes the following valgrind error: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) _cairo_pattern_create_solid (cairo-pattern.c:605) _cairo_pattern_create_in_error (cairo-pattern.c:628) cairo_pop_group (cairo.c:552) test_cairo_push_group (api-special-cases.c:157) preamble (api-special-cases.c:1766) main (cairo-test-runner.c:228) Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
-rw-r--r--test/api-special-cases.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/api-special-cases.c b/test/api-special-cases.c
index e8611525f..c4a754dee 100644
--- a/test/api-special-cases.c
+++ b/test/api-special-cases.c
@@ -181,7 +181,9 @@ test_cairo_set_operator (cairo_t *cr)
static cairo_test_status_t
test_cairo_set_source (cairo_t *cr)
{
- cairo_set_source (cr, cairo_pattern_create_rgb (0, 0, 0));
+ cairo_pattern_t *source = cairo_pattern_create_rgb (0, 0, 0);
+ cairo_set_source (cr, source);
+ cairo_pattern_destroy (source);
return CAIRO_TEST_SUCCESS;
}