From c48dd8049ccc46c075c9836c4bd3a66ed3edd83a Mon Sep 17 00:00:00 2001 From: Tim Wiederhake Date: Mon, 24 Jan 2011 07:59:15 -0800 Subject: [PATCH] secure malloc in translate_cache_create Signed-off-by: Brian Paul --- src/gallium/auxiliary/translate/translate_cache.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gallium/auxiliary/translate/translate_cache.c b/src/gallium/auxiliary/translate/translate_cache.c index d8069a149cf..3f1ecb630f2 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; } -- 2.30.2