diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-05-04 10:26:30 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-05-04 13:28:37 +0100 |
commit | 4a181ebac416ec35e412ddbe9ed1392fb8b74ab7 (patch) | |
tree | 751d356b2a5be5a82270cd34f25cd70d10342557 /src/cairo-pdf-surface.c | |
parent | ba48edcd86ee1bca06b25587e56abcd2c1b19d79 (diff) |
pdf: Cleanup local reference to source on error paths.
Diffstat (limited to 'src/cairo-pdf-surface.c')
-rw-r--r-- | src/cairo-pdf-surface.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c index a76d289e..da51295c 100644 --- a/src/cairo-pdf-surface.c +++ b/src/cairo-pdf-surface.c @@ -1150,6 +1150,7 @@ _cairo_pdf_surface_add_source_surface (cairo_pdf_surface_t *surface, src_surface.surface = cairo_surface_reference (source); surface_entry->surface_res = _cairo_pdf_surface_new_object (surface); if (surface_entry->surface_res.id == 0) { + cairo_surface_destroy (source); free (surface_entry); return _cairo_error (CAIRO_STATUS_NO_MEMORY); } @@ -1159,6 +1160,7 @@ _cairo_pdf_surface_add_source_surface (cairo_pdf_surface_t *surface, status = _cairo_array_append (&surface->page_surfaces, &src_surface); if (unlikely (status)) { + cairo_surface_destroy (source); free (surface_entry); return status; } |