From: Mark Wooding Date: Wed, 13 Nov 2019 02:50:55 +0000 (+0000) Subject: mp.c: Release the `GFN' object through channels on error. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/catacomb-python/commitdiff_plain/79ac6c22fec9bad43320f43e6fefb31bdb7f9847?hp=79ac6c22fec9bad43320f43e6fefb31bdb7f9847 mp.c: Release the `GFN' object through channels on error. If the given element turns out not to actually generate a normal basis then we have to give up constructing the `GFN' object and raise an exception. In turns out that debug versions of Python get really unhappy if you try to free objects which still have nonzero reference counts, so: * use `Py_DECREF' to free the object on error; and * mark the object (by leaving `p' null) so that we don't actually free the conversion matrices if they're weren't set up. ---