summaryrefslogtreecommitdiff
path: root/Python/_warnings.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/_warnings.c')
-rw-r--r--Python/_warnings.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c
index 0e48675d81..e75d4fd06a 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -400,6 +400,8 @@ warn_explicit(PyObject *category, PyObject *message,
PyErr_SetString(PyExc_TypeError,
"warnings.showwarning() must be set to a "
"function or method");
+ Py_DECREF(show_fxn);
+ goto cleanup;
}
defaults = PyFunction_GetDefaults(check_fxn);