diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2007-10-04 00:38:12 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2007-10-04 00:42:30 +0100 |
commit | 8ad56b308ae8bbecfe9873c21551a6d4b2302420 (patch) | |
tree | a9c8791e8c30f70fc24a1b1ade069e54c23d98be /src/cairo-cache.c | |
parent | 66664596559c55913fb0b9c8784fe8ab862c217b (diff) | |
download | cairo-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-cache.c')
-rw-r--r-- | src/cairo-cache.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cairo-cache.c b/src/cairo-cache.c index 18c3d8cca..a7c27c128 100644 --- a/src/cairo-cache.c +++ b/src/cairo-cache.c @@ -131,8 +131,10 @@ _cairo_cache_create (cairo_cache_keys_equal_func_t keys_equal, cairo_cache_t *cache; cache = malloc (sizeof (cairo_cache_t)); - if (cache == NULL) + if (cache == NULL) { + _cairo_error (CAIRO_STATUS_NO_MEMORY); return NULL; + } status = _cairo_cache_init (cache, keys_equal, entry_destroy, max_size); if (status) { |