mirror of
				https://notabug.org/scuti/lib3ddevil1
				synced 2025-05-31 14:11:42 +05:30 
			
		
		
		
	Added missing free for newBatches malloc
This commit is contained in:
		@@ -21,8 +21,10 @@ void writemesh(const struct MeshHeader *mh,
 | 
			
		||||
    write(fn, (char*)(&h),         sizeof(struct Header));
 | 
			
		||||
    append(fn, (char*)(&newmh),    sizeof(struct MeshHeader));
 | 
			
		||||
 | 
			
		||||
    struct BatchData * newBatches = malloc(newmh.numBatch * sizeof(struct BatchData));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    // batch data the same treatment.
 | 
			
		||||
    struct BatchData * newBatches = malloc(newmh.numBatch * sizeof(struct BatchData));
 | 
			
		||||
    uint64_t previousBatch = 0;
 | 
			
		||||
    for (int i = 0; i < newmh.numBatch; i++) {
 | 
			
		||||
      newBatches[i] = (m -> b) -> bd[i];
 | 
			
		||||
@@ -51,6 +53,7 @@ void writemesh(const struct MeshHeader *mh,
 | 
			
		||||
      append(fn, (char*)(m -> b[i].vd.bw),        sizeof(struct BoneWeights) * nVertices);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    free(newBatches);
 | 
			
		||||
    free(fn);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user