Fix math.factorial KeyboardInterrupt segfault. Thanks Amaury for report and diagnosis.

This commit is contained in:
Mark Dickinson 2012-10-25 10:46:28 +01:00
parent 837cd06d36
commit 76464494bc
2 changed files with 6 additions and 4 deletions

View file

@ -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 */