From 8ad56b308ae8bbecfe9873c21551a6d4b2302420 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 4 Oct 2007 00:38:12 +0100 Subject: [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. --- src/cairo-font-face.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/cairo-font-face.c') 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) -- cgit v1.2.1