[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [10781] trunk/blender/source/blender/ python/api2_2x/Armature.c: Fix segfault in PyBonesDict_FromPyArmature() caused by uninitialized memory.

Ken Hughes khughes at pacific.edu
Fri May 25 22:54:49 CEST 2007


Revision: 10781
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bforge-svn&revision=10781
Author:   khughes
Date:     2007-05-25 22:54:48 +0200 (Fri, 25 May 2007)

Log Message:
-----------
Fix segfault in PyBonesDict_FromPyArmature() caused by uninitialized memory.

Modified Paths:
--------------
    trunk/blender/source/blender/python/api2_2x/Armature.c

Modified: trunk/blender/source/blender/python/api2_2x/Armature.c
===================================================================
--- trunk/blender/source/blender/python/api2_2x/Armature.c	2007-05-25 17:32:41 UTC (rev 10780)
+++ trunk/blender/source/blender/python/api2_2x/Armature.c	2007-05-25 20:54:48 UTC (rev 10781)
@@ -428,6 +428,9 @@
 	if (!py_BonesDict)
 		goto RuntimeError;
 
+	py_BonesDict->bones = NULL;
+	py_BonesDict->editbones.first = py_BonesDict->editbones.last = NULL;
+
 	//create internal dictionaries
 	py_BonesDict->bonesMap = PyDict_New();
 	py_BonesDict->editbonesMap = PyDict_New();
@@ -1294,7 +1297,7 @@
  * Converts a bArmature to a PyArmature
  * 
  * WARNING!!! - MEMORY LEAK HERE, Run in a loop and loose your ram.
- * cannot find out why but dosnt seam to be the weakref */
+ * cannot find out why but doesn't seem to be the weakref */
 
 PyObject *Armature_CreatePyObject(struct bArmature *armature)
 {





More information about the Bf-blender-cvs mailing list