Call (sub)type tp_free from destructors
[platform/upstream/rpm.git] / python / rpmps-py.c
index 82422c0..c9f6050 100644 (file)
@@ -61,10 +61,8 @@ static struct PyMethodDef rpmps_methods[] = {
 static void
 rpmps_dealloc(rpmpsObject * s)
 {
-    if (s) {
-       s->ps = rpmpsFree(s->ps);
-       PyObject_Del(s);
-    }
+    s->ps = rpmpsFree(s->ps);
+    s->ob_type->tp_free((PyObject *)s);
 }
 
 static int