[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:
Chris Wilson 2007-05-08 13:55:04 +01:00
parent eac18d44c7
commit 0bf3ffacda

View file

@ -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;
}