diff --git a/src/cairo-path-stroke.c b/src/cairo-path-stroke.c index 958b95a11..09bafbf8e 100644 --- a/src/cairo-path-stroke.c +++ b/src/cairo-path-stroke.c @@ -1282,16 +1282,17 @@ _cairo_path_fixed_stroke_rectilinear (cairo_path_fixed_t *path, NULL, _cairo_rectilinear_stroker_close_path, &rectilinear_stroker); - if (status) { - _cairo_traps_fini (traps); - return status; - } + if (status) + goto BAIL; status = _cairo_rectilinear_stroker_emit_segments (&rectilinear_stroker); - if (status) - return status; + +BAIL: _cairo_rectilinear_stroker_fini (&rectilinear_stroker); - return CAIRO_STATUS_SUCCESS; + if (status) + _cairo_traps_fini (traps); + + return status; }