projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b0f9717
)
mesa: Test for failed malloc in _mesa_HashInsert.
author
Brian Paul
<brianp@vmware.com>
Tue, 16 Feb 2010 15:21:28 +0000
(08:21 -0700)
committer
Brian Paul
<brianp@vmware.com>
Tue, 16 Feb 2010 15:21:28 +0000
(08:21 -0700)
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit
7c7247ddbf6e3f7f93e44c1cb52490044f1a2215
)
src/mesa/main/hash.c
patch
|
blob
|
history
diff --git
a/src/mesa/main/hash.c
b/src/mesa/main/hash.c
index 08c64568c83d369611510f8fb6cef0b94db2ea8c..7c3c7a6bdbb8533b97eaf97c2ac53c6430ca6339 100644
(file)
--- a/
src/mesa/main/hash.c
+++ b/
src/mesa/main/hash.c
@@
-191,10
+191,12
@@
_mesa_HashInsert(struct _mesa_HashTable *table, GLuint key, void *data)
/* alloc and insert new table entry */
entry = MALLOC_STRUCT(HashEntry);
- entry->Key = key;
- entry->Data = data;
- entry->Next = table->Table[pos];
- table->Table[pos] = entry;
+ if (entry) {
+ entry->Key = key;
+ entry->Data = data;
+ entry->Next = table->Table[pos];
+ table->Table[pos] = entry;
+ }
_glthread_UNLOCK_MUTEX(table->Mutex);
}