summaryrefslogtreecommitdiff
path: root/src/cairo-cache.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-cache.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-cache.c')
-rw-r--r--src/cairo-cache.c4
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) {