mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-02 08:28:01 +02:00
[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:
parent
5efc5238d5
commit
1dd894115e
1 changed files with 3 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue