diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2007-10-04 00:38:12 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2007-10-04 00:42:30 +0100 |
commit | 8ad56b308ae8bbecfe9873c21551a6d4b2302420 (patch) | |
tree | a9c8791e8c30f70fc24a1b1ade069e54c23d98be /src/cairo-type1-fallback.c | |
parent | 66664596559c55913fb0b9c8784fe8ab862c217b (diff) |
[malloc/error] Add call to _cairo_error() after a failed malloc.
Blitz all allocations to ensure that they raise a
_cairo_error(CAIRO_STATUS_NO_MEMORY) on failure.
Diffstat (limited to 'src/cairo-type1-fallback.c')
-rw-r--r-- | src/cairo-type1-fallback.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cairo-type1-fallback.c b/src/cairo-type1-fallback.c index 387277785..564b4b060 100644 --- a/src/cairo-type1-fallback.c +++ b/src/cairo-type1-fallback.c @@ -80,13 +80,16 @@ cairo_type1_font_create (cairo_scaled_font_subset_t *scaled_font_subset, cairo_font_options_t font_options; font = calloc (1, sizeof (cairo_type1_font_t)); - if (font == NULL) + if (font == NULL) { + _cairo_error (CAIRO_STATUS_NO_MEMORY); return CAIRO_STATUS_NO_MEMORY; + } font->widths = calloc (scaled_font_subset->num_glyphs, sizeof (int)); if (font->widths == NULL) { free (font); + _cairo_error (CAIRO_STATUS_NO_MEMORY); return CAIRO_STATUS_NO_MEMORY; } @@ -781,6 +784,7 @@ _cairo_type1_fallback_init_internal (cairo_type1_subset_t *type1_subset, /* status is already set, ignore further errors */ cairo_type1_font_destroy (font); + _cairo_error (status); return status; } @@ -873,6 +877,7 @@ fail2: _cairo_type2_charstrings_fini (type2_subset); fail1: cairo_type1_font_destroy (font); + _cairo_error (status); return status; } |