diff options
author | Mark Dickinson <mdickinson@enthought.com> | 2012-10-25 10:46:28 +0100 |
---|---|---|
committer | Mark Dickinson <mdickinson@enthought.com> | 2012-10-25 10:46:28 +0100 |
commit | 40ec9bea0800845f2c2323864e543e277d3b9ada (patch) | |
tree | eeb4d38039e14cdf29b3cc681e67308f1c71a79c /Modules | |
parent | f374fd439129c8845636dbcd6b9db788ca30ddc5 (diff) | |
download | cpython-40ec9bea0800845f2c2323864e543e277d3b9ada.tar.gz |
Fix math.factorial KeyboardInterrupt segfault. Thanks Amaury for report and diagnosis.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/mathmodule.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c index 2c4cc7331b..142eca468a 100644 --- a/Modules/mathmodule.c +++ b/Modules/mathmodule.c @@ -1330,14 +1330,13 @@ factorial_odd_part(unsigned long n) Py_DECREF(outer); outer = tmp; } - - goto done; + Py_DECREF(inner); + return outer; error: Py_DECREF(outer); - done: Py_DECREF(inner); - return outer; + return NULL; } /* Lookup table for small factorial values */ |