fix potential crasher: malloc->calloc
authorNathan Letwory <nathan@letworyinteractive.com>
Thu, 14 Oct 2010 10:34:04 +0000 (10:34 +0000)
committerNathan Letwory <nathan@letworyinteractive.com>
Thu, 14 Oct 2010 10:34:04 +0000 (10:34 +0000)
source/blender/blenkernel/intern/mesh.c

index 6f1cdef..3e9287d 100644 (file)
@@ -1221,7 +1221,7 @@ void mesh_set_smooth_flag(Object *meshOb, int enableSmooth)
 void mesh_calc_normals(MVert *mverts, int numVerts, MFace *mfaces, int numFaces, float **faceNors_r) 
 {
        float (*tnorms)[3]= MEM_callocN(numVerts*sizeof(*tnorms), "tnorms");
-       float *fnors= MEM_mallocN(sizeof(*fnors)*3*numFaces, "meshnormals");
+       float *fnors= MEM_callocN(sizeof(*fnors)*3*numFaces, "meshnormals");
        int i;
 
        for (i=0; i<numFaces; i++) {