diff options
author | Kent Mein <mein@cs.umn.edu> | 2006-10-27 19:00:31 +0400 |
---|---|---|
committer | Kent Mein <mein@cs.umn.edu> | 2006-10-27 19:00:31 +0400 |
commit | 4657db2a38550a46dbd5028ad283f399de6adf0e (patch) | |
tree | 26bb0c4fcc403d9a717699ab89e36f915b8882b6 /intern/guardedalloc | |
parent | 45c1f23f19169a4bc2640db3fd2d7b67386609dc (diff) |
More bugs found thanks to klockwork
mallocn.c check malloced memory before using it.
ssp_blas2.c free memory that wasn't but should have been.
Kent
Diffstat (limited to 'intern/guardedalloc')
-rw-r--r-- | intern/guardedalloc/intern/mallocn.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/intern/guardedalloc/intern/mallocn.c b/intern/guardedalloc/intern/mallocn.c index 03a3a786df2..77184ac9370 100644 --- a/intern/guardedalloc/intern/mallocn.c +++ b/intern/guardedalloc/intern/mallocn.c @@ -210,6 +210,9 @@ void *MEM_dupallocN(void *vmemh) newp= MEM_mapallocN(memh->len, "dupli_mapalloc"); else newp= MEM_mallocN(memh->len, "dupli_alloc"); + + if (newp == NULL) return NULL; + memcpy(newp, vmemh, memh->len); } |