summaryrefslogtreecommitdiff
path: root/boilerplate/cairo-boilerplate-ps.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2007-05-08 16:35:14 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2007-05-08 16:48:34 +0100
commite3acacc096d7db947e7c8f2167a6d97f04c403b1 (patch)
treed629ac1f6aa9a96950b0feeba4792340cfd1fd05 /boilerplate/cairo-boilerplate-ps.c
parentefd212bfa25cb44b9499b89f93aa7167a9544ccb (diff)
[cairo-boilerplate-ps] Destroy the target on creation failure
Remember to destroy the ptc->target as well as the ordinary surface, if we need to.
Diffstat (limited to 'boilerplate/cairo-boilerplate-ps.c')
-rw-r--r--boilerplate/cairo-boilerplate-ps.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/boilerplate/cairo-boilerplate-ps.c b/boilerplate/cairo-boilerplate-ps.c
index 0e7a764a..7d5ea7d4 100644
--- a/boilerplate/cairo-boilerplate-ps.c
+++ b/boilerplate/cairo-boilerplate-ps.c
@@ -87,6 +87,8 @@ _cairo_boilerplate_ps_create_surface (const char *name,
ptc,
NULL) != CAIRO_STATUS_SUCCESS) {
cairo_surface_destroy (surface);
+ if (ptc->target != NULL)
+ cairo_surface_destroy (ptc->target);
free (ptc->filename);
free (ptc);
return NULL;