summaryrefslogtreecommitdiff
path: root/src/cairo-font-face.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2007-10-04 00:38:12 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2007-10-04 00:42:30 +0100
commit8ad56b308ae8bbecfe9873c21551a6d4b2302420 (patch)
treea9c8791e8c30f70fc24a1b1ade069e54c23d98be /src/cairo-font-face.c
parent66664596559c55913fb0b9c8784fe8ab862c217b (diff)
downloadcairo-8ad56b308ae8bbecfe9873c21551a6d4b2302420.tar.gz
[malloc/error] Add call to _cairo_error() after a failed malloc.
Blitz all allocations to ensure that they raise a _cairo_error(CAIRO_STATUS_NO_MEMORY) on failure.
Diffstat (limited to 'src/cairo-font-face.c')
-rw-r--r--src/cairo-font-face.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cairo-font-face.c b/src/cairo-font-face.c
index c64802096..b3bcc843d 100644
--- a/src/cairo-font-face.c
+++ b/src/cairo-font-face.c
@@ -395,8 +395,10 @@ _cairo_toy_font_face_create (const char *family,
/* Otherwise create it and insert into hash table. */
font_face = malloc (sizeof (cairo_toy_font_face_t));
- if (font_face == NULL)
+ if (font_face == NULL) {
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
goto UNWIND_HASH_TABLE_LOCK;
+ }
status = _cairo_toy_font_face_init (font_face, family, slant, weight);
if (status)