From dcdcb7ac2acf39c54da855b6a2af4d02a7165a24 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 1 Mar 2007 18:36:16 -0500 Subject: [PATCH] Fix leak in rectilinear stroking code The code was not cleaning up after itself when rejecting a path as rectilinear. --- src/cairo-path-stroke.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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; }