for (i = 0; i < len; ++i)
Py_XDECREF (callbacks[i]);
+ free (callbacks);
Py_INCREF (Py_None);
return Py_None;
snprintf (key, sizeof key, "_python_event_%d", eh);
guestfs_set_private (g, key, py_callback);
- py_eh = PyInt_FromLong ((long) eh);
+ py_eh = PyLong_FromLong ((long) eh);
return py_eh;
}