[Bf-blender-cvs] [bde80cb] master: Fix memory leak in hook modifier's data copy

Sergey Sharybin noreply at git.blender.org
Sat Jan 30 15:41:13 CET 2016


Commit: bde80cbb14133c6feb55d0ec1e26cf87b6dcb378
Author: Sergey Sharybin
Date:   Sat Jan 30 15:40:24 2016 +0100
Branches: master
https://developer.blender.org/rBbde80cbb14133c6feb55d0ec1e26cf87b6dcb378

Fix memory leak in hook modifier's data copy

===================================================================

M	source/blender/modifiers/intern/MOD_hook.c

===================================================================

diff --git a/source/blender/modifiers/intern/MOD_hook.c b/source/blender/modifiers/intern/MOD_hook.c
index 1a27202..e175f49 100644
--- a/source/blender/modifiers/intern/MOD_hook.c
+++ b/source/blender/modifiers/intern/MOD_hook.c
@@ -67,6 +67,13 @@ static void copyData(ModifierData *md, ModifierData *target)
 	HookModifierData *hmd = (HookModifierData *) md;
 	HookModifierData *thmd = (HookModifierData *) target;
 
+	if (thmd->curfalloff != NULL) {
+		curvemapping_free(thmd->curfalloff);
+	}
+	if (thmd->indexar != NULL) {
+		MEM_freeN(thmd->indexar);
+	}
+
 	modifier_copyData_generic(md, target);
 
 	thmd->curfalloff = curvemapping_copy(hmd->curfalloff);




More information about the Bf-blender-cvs mailing list