diff options
author | Mark Dickinson <mdickinson@enthought.com> | 2012-10-25 09:48:39 (GMT) |
---|---|---|
committer | Mark Dickinson <mdickinson@enthought.com> | 2012-10-25 09:48:39 (GMT) |
commit | 9588593b791d2c0052296f3df462350280dd3747 (patch) | |
tree | 13e7eed5223029b6500ae9f508ee827dddf75c15 | |
parent | a19f601fdffab73b2e8d64235c5a44432721a9d1 (diff) | |
parent | 039e0cdc28ebcea7a6364d6277f11ed330e38028 (diff) | |
download | cpython-9588593b791d2c0052296f3df462350280dd3747.zip cpython-9588593b791d2c0052296f3df462350280dd3747.tar.gz cpython-9588593b791d2c0052296f3df462350280dd3747.tar.bz2 |
Issue #16305: Merge fix from 3.3.
-rw-r--r-- | Misc/NEWS | 3 | ||||
-rw-r--r-- | Modules/mathmodule.c | 7 |
2 files changed, 6 insertions, 4 deletions
@@ -62,6 +62,9 @@ Core and Builtins Library ------- +- Issue #16305: Fix a segmentation fault occurring when interrupting + math.factorial. + - Issue #16116: Fix include and library paths to be correct when building C extensions in venvs. diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c index d693da1..3fa52d0 100644 --- a/Modules/mathmodule.c +++ b/Modules/mathmodule.c @@ -1381,14 +1381,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 */ |