[cairo-commit] src/cairo-win32-font.c
Vladimir Vukicevic
vladimir at kemper.freedesktop.org
Wed Aug 29 13:09:41 PDT 2007
src/cairo-win32-font.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
New commits:
diff-tree bdc70d1fc2a31aa829571244c54f98210e97a2cf (from 114b07881e8b09f97394dd4fe8f2900ee9f4c348)
Author: Vladimir Vukicevic <vladimir at pobox.com>
Date: Wed Aug 29 12:52:00 2007 -0700
[win32] call scaled_font_fini in create before returning NULL
diff --git a/src/cairo-win32-font.c b/src/cairo-win32-font.c
index dfb475f..484ca17 100644
--- a/src/cairo-win32-font.c
+++ b/src/cairo-win32-font.c
@@ -303,16 +303,21 @@ _win32_scaled_font_create (LOGFONTW
status = _cairo_scaled_font_init (&f->base, font_face,
font_matrix, ctm, options,
&cairo_win32_scaled_font_backend);
+ if (status)
+ goto FAIL;
- if (status == CAIRO_STATUS_SUCCESS)
- status = _cairo_win32_scaled_font_set_metrics (f);
+ status = _cairo_win32_scaled_font_set_metrics (f);
if (status) {
- free (f);
- return NULL;
+ _cairo_scaled_font_fini (&f->base);
+ goto FAIL;
}
return &f->base;
+
+ FAIL:
+ free (f);
+ return NULL;
}
static cairo_status_t
More information about the cairo-commit
mailing list