summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Wiederhake <twied@gmx.net>2011-01-24 07:59:15 -0800
committerBrian Paul <brianp@vmware.com>2011-01-24 09:17:54 -0700
commitc48dd8049ccc46c075c9836c4bd3a66ed3edd83a (patch)
treea7b92ec2030327ad20463560beefbc63598eba3b
parent7d6abd254a46e37a27401c3ae0ce0645d8b0decd (diff)
secure malloc in translate_cache_create
Signed-off-by: Brian Paul <brianp@vmware.com>
-rw-r--r--src/gallium/auxiliary/translate/translate_cache.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/translate/translate_cache.c b/src/gallium/auxiliary/translate/translate_cache.c
index d8069a149c..3f1ecb630f 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;
}