diff Modules/mathmodule.c @ 79933:b4bfcf7a4773 3.2

Fix math.factorial KeyboardInterrupt segfault. Thanks Amaury for report and diagnosis.
author Mark Dickinson <mdickinson@enthought.com>
date Thu, 25 Oct 2012 10:46:28 +0100
parents 692efd6ac771
children 19ed42e84030
line wrap: on
line diff
--- a/Modules/mathmodule.c	Wed Oct 24 23:06:25 2012 +0300
+++ b/Modules/mathmodule.c	Thu Oct 25 10:46:28 2012 +0100
@@ -1330,14 +1330,13 @@
         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 */