Commits

marcus  committed b936f12

Fixed some memory leaks.

  • Participants
  • Parent commits 08deb07
  • Branches pgreloaded

Comments (0)

Files changed (2)

File src/base/rect.c

 _rect_init (PyObject *self, PyObject *args, PyObject *kwds)
 {
     pgint16 x, y;
-    pgint32 w, h;
+    pgint32 w = 0, h = 0;
 
     if (!PyArg_ParseTuple (args, "iill", &x, &y, &w, &h))
     {

File src/math/vector3.c

     }
     ret = (PyVector*) PyVector3_New (0.f, 0.f, 0.f);
     _do_rotate (ret->coords, v->coords, axiscoords, angle, v->epsilon);
+    PyMem_Free (axiscoords);
     return (PyObject*) ret;
 }
 
 
     memcpy (tmp, v->coords, sizeof (double) * 3);
     _do_rotate (v->coords, tmp, axiscoords, angle, v->epsilon);
+    PyMem_Free (axiscoords);
     Py_RETURN_NONE;
 }
 
     tmp2 = _ScalarProduct (othercoords, othercoords, otherdim);
     angle = acos (_ScalarProduct (v->coords, othercoords, v->dim) /
         sqrt (tmp1 * tmp2));
+    PyMem_Free (othercoords);
 
     return PyFloat_FromDouble (RAD2DEG (angle));
 }