mp.c: Release the `GFN' object through channels on error.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 13 Nov 2019 02:50:55 +0000 (02:50 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 22 Nov 2019 22:18:11 +0000 (22:18 +0000)
commit79ac6c22fec9bad43320f43e6fefb31bdb7f9847
treeff709209e45cec637dea0f08e7b00f6ada49289e
parentd2b7e92ced5df6a556220b98488cd3cb84a721b5
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.
mp.c