mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-31 05:30:19 +01:00
[test-fallback-surface] Destroy the backing image on malloc failure.
Ensure we free all local resource should we encounter an allocation failure during _cairo_test_fallback_surface_create().
This commit is contained in:
parent
eac18d44c7
commit
0bf3ffacda
1 changed files with 1 additions and 0 deletions
|
|
@ -80,6 +80,7 @@ _cairo_test_fallback_surface_create (cairo_content_t content,
|
|||
|
||||
surface = malloc (sizeof (test_fallback_surface_t));
|
||||
if (surface == NULL) {
|
||||
cairo_surface_destroy (backing);
|
||||
_cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
return (cairo_surface_t*) &_cairo_surface_nil;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue