diff options
-rw-r--r-- | intern/guardedalloc/intern/mallocn.c | 3 | ||||
-rw-r--r-- | intern/opennl/superlu/ssp_blas2.c | 5 |
2 files changed, 7 insertions, 1 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); } diff --git a/intern/opennl/superlu/ssp_blas2.c b/intern/opennl/superlu/ssp_blas2.c index 347f9ab5fd4..e9f8f53128a 100644 --- a/intern/opennl/superlu/ssp_blas2.c +++ b/intern/opennl/superlu/ssp_blas2.c @@ -119,7 +119,10 @@ sp_strsv(char *uplo, char *trans, char *diag, SuperMatrix *L, if ( lsame_(uplo, "L") ) { /* Form x := inv(L)*x */ - if ( L->nrow == 0 ) return 0; /* Quick return */ + if ( L->nrow == 0 ) { + SUPERLU_FREE(work); + return 0; /* Quick return */ + } for (k = 0; k <= Lstore->nsuper; k++) { fsupc = L_FST_SUPC(k); |