Call (sub)type tp_free from destructors
[platform/upstream/rpm.git] / python / rpmfi-py.c
index 9a27e04..860e069 100644 (file)
@@ -257,10 +257,8 @@ static struct PyMethodDef rpmfi_methods[] = {
 static void
 rpmfi_dealloc(rpmfiObject * s)
 {
-    if (s) {
-       s->fi = rpmfiFree(s->fi);
-       PyObject_Del(s);
-    }
+    s->fi = rpmfiFree(s->fi);
+    s->ob_type->tp_free((PyObject *)s);
 }
 
 static int