Skip to content

Commit 3a27b08

Browse files
committed
do not decref value borrowed from list (closes python#27774)
1 parent 4f97651 commit 3a27b08

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ Core and Builtins
2929
Library
3030
-------
3131

32+
- Issue #27774: Fix possible Py_DECREF on unowned object in _sre.
33+
3234
- Issue #27760: Fix possible integer overflow in binascii.b2a_qp.
3335

3436
- Issue #27758: Fix possible integer overflow in the _csv module for large record

Modules/_sre.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3401,10 +3401,8 @@ match_groupdict(MatchObject* self, PyObject* args, PyObject* kw)
34013401
if (!key)
34023402
goto failed;
34033403
value = match_getslice(self, key, def);
3404-
if (!value) {
3405-
Py_DECREF(key);
3404+
if (!value)
34063405
goto failed;
3407-
}
34083406
status = PyDict_SetItem(result, key, value);
34093407
Py_DECREF(value);
34103408
if (status < 0)

0 commit comments

Comments
 (0)