summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS2
-rw-r--r--Modules/_sre.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 60a248b..1e2a7b7 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -107,6 +107,8 @@ Library
- In the curses module, raise an error if window.getstr() or window.instr() is
passed a negative value.
+- Issue #27774: Fix possible Py_DECREF on unowned object in _sre.
+
- Issue #27760: Fix possible integer overflow in binascii.b2a_qp.
- Issue #27758: Fix possible integer overflow in the _csv module for large record
diff --git a/Modules/_sre.c b/Modules/_sre.c
index 512b3f2..6f8ec0e 100644
--- a/Modules/_sre.c
+++ b/Modules/_sre.c
@@ -2194,10 +2194,8 @@ _sre_SRE_Match_groupdict_impl(MatchObject *self, PyObject *default_value)
if (!key)
goto failed;
value = match_getslice(self, key, default_value);
- if (!value) {
- Py_DECREF(key);
+ if (!value)
goto failed;
- }
status = PyDict_SetItem(result, key, value);
Py_DECREF(value);
if (status < 0)