Commit: 1dc314342d0e1831bb46b3f45f9b2a052ef631d0
Author: Martin Felke
Date:   Thu Nov 13 01:43:07 2014 +0100
Branches: fracture_modifier
https://developer.blender.org/rB1dc314342d0e1831bb46b3f45f9b2a052ef631d0

memory leak fix in find_normal

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

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

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

diff --git a/source/blender/modifiers/intern/MOD_fracture.c 
b/source/blender/modifiers/intern/MOD_fracture.c
index 6d80459..7165524 100644
--- a/source/blender/modifiers/intern/MOD_fracture.c
+++ b/source/blender/modifiers/intern/MOD_fracture.c
@@ -465,11 +465,15 @@ static void find_normal(DerivedMesh *dm, KDTree *tree, 
float co[3], short no[3],
                                MEM_freeN(n);
                                n = NULL;
                        }
-
                        return;
                }
        }
 
+       if (n != NULL) {
+               MEM_freeN(n);
+               n = NULL;
+       }
+
        /*fallback if no valid normal in searchrange....*/
        BLI_kdtree_find_nearest(tree, co, &n2);
        index = n2.index;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to