From: Tim Wiederhake Date: Mon, 24 Jan 2011 15:59:15 +0000 (-0800) Subject: secure malloc in translate_cache_create X-Git-Tag: mesa-7.11-rc1~2530 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c48dd8049ccc46c075c9836c4bd3a66ed3edd83a;p=platform%2Fupstream%2Fmesa.git secure malloc in translate_cache_create Signed-off-by: Brian Paul --- diff --git a/src/gallium/auxiliary/translate/translate_cache.c b/src/gallium/auxiliary/translate/translate_cache.c index d8069a1..3f1ecb6 100644 --- a/src/gallium/auxiliary/translate/translate_cache.c +++ b/src/gallium/auxiliary/translate/translate_cache.c @@ -40,6 +40,10 @@ struct translate_cache { struct translate_cache * translate_cache_create( void ) { struct translate_cache *cache = MALLOC_STRUCT(translate_cache); + if (cache == NULL) { + return NULL; + } + cache->hash = cso_hash_create(); return cache; }