Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/blenkernel/intern/particle_system.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index e35504d73d7..a0948e61708 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -221,16 +221,18 @@ static void realloc_particles(ParticleSimulationData *sim, int new_totpart)
if(totpart) {
newpars= MEM_callocN(totpart*sizeof(ParticleData), "particles");
- if(psys->part->phystype == PART_PHYS_BOIDS)
+ if(newpars == NULL)
+ return;
+
+ if(psys->part->phystype == PART_PHYS_BOIDS) {
newboids= MEM_callocN(totpart*sizeof(BoidParticle), "boid particles");
- if(ELEM(NULL, newpars, newboids)) {
- /* allocation error! */
- if(newpars)
- MEM_freeN(newpars);
- if(newboids)
- MEM_freeN(newboids);
- return;
+ if(newboids == NULL) {
+ /* allocation error! */
+ if(newpars)
+ MEM_freeN(newpars);
+ return;
+ }
}
}