Citing Debian bug #468989 :
[..] The C API requires using the same memory API for a given memory block, which will show up as a segfault, at least in python2.5. This code was found by a search of all sources build-depending on python-dev, having a PyObject_ function for allocation and a PyMem_ function for deallocation in the same file. [..]
The attached patch is the proposed fix applied for Debian.