summaryrefslogtreecommitdiff
path: root/test/mime-data.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-01-29 09:50:38 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2009-01-29 10:10:41 +0000
commit8388af137841679b7c510980daf3cec1427b6e6b (patch)
tree2abd6336f5c3944b0d346c64f2fdaa2c6a78cb68 /test/mime-data.c
parent3752f690b467432ab5b1058d450cb79d719a794a (diff)
downloadcairo-8388af137841679b7c510980daf3cec1427b6e6b.tar.gz
[test] Trivial fixes for error paths.
Kill a few leaks along error paths in the test code.
Diffstat (limited to 'test/mime-data.c')
-rw-r--r--test/mime-data.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/mime-data.c b/test/mime-data.c
index febc32260..b1074cdeb 100644
--- a/test/mime-data.c
+++ b/test/mime-data.c
@@ -44,6 +44,9 @@ read_file (const cairo_test_context_t *ctx,
if (file == NULL) {
char path[4096];
+ if (errno == ENOMEM)
+ return CAIRO_STATUS_NO_MEMORY;
+
/* try again with srcdir */
snprintf (path, sizeof (path),
"%s/%s", ctx->srcdir, filename);
@@ -100,6 +103,7 @@ paint_file (cairo_t *cr,
free, mime_data);
if (status) {
cairo_surface_destroy (image);
+ free (mime_data);
return cairo_test_status_from_status (ctx, status);
}