Fix segfault in PyBonesDict_FromPyArmature() caused by uninitialized memory.
authorKen Hughes <khughes@pacific.edu>
Fri, 25 May 2007 20:54:48 +0000 (20:54 +0000)
committerKen Hughes <khughes@pacific.edu>
Fri, 25 May 2007 20:54:48 +0000 (20:54 +0000)
source/blender/python/api2_2x/Armature.c

index a4c9221639f9654017f2da63b13768b66eb53923..c82597f9b00d5878425619f43b04b8e3516271be 100644 (file)
@@ -428,6 +428,9 @@ static PyObject *PyBonesDict_FromPyArmature(BPy_Armature *py_armature)
        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 @@ PyObject *Armature_RebuildBones(PyObject *pyarmature)
  * 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)
 {