[cairo-pattern] Raise an error for _cairo_pattern_create_solid() failure.

Add a missing _cairo_error() for the malloc failure in
_cairo_pattern_create_solid().
This commit is contained in:
Chris Wilson 2008-03-04 09:04:17 +00:00
parent 5efc5238d5
commit 1dd894115e

View file

@ -341,9 +341,10 @@ _cairo_pattern_create_solid (const cairo_color_t *color,
pattern = malloc (sizeof (cairo_solid_pattern_t));
}
if (pattern == NULL)
if (pattern == NULL) {
_cairo_error_throw (CAIRO_STATUS_NO_MEMORY);
pattern = (cairo_solid_pattern_t *) &_cairo_pattern_nil;
else
} else
_cairo_pattern_init_solid (pattern, color, content);
return &pattern->base;