diff options
author | Benjamin Peterson <benjamin@python.org> | 2016-08-16 05:01:41 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2016-08-16 05:01:41 (GMT) |
commit | 3a27b0857ef6d35911509eef88e567663bb0a0b6 (patch) | |
tree | 7ebb4abf7c82f3c1535d8660fbd9dabb355a4b23 /Modules/_sre.c | |
parent | 4f976513efd8d411126e09d036842d0691c49c82 (diff) | |
download | cpython-3a27b0857ef6d35911509eef88e567663bb0a0b6.zip cpython-3a27b0857ef6d35911509eef88e567663bb0a0b6.tar.gz cpython-3a27b0857ef6d35911509eef88e567663bb0a0b6.tar.bz2 |
do not decref value borrowed from list (closes #27774)
Diffstat (limited to 'Modules/_sre.c')
-rw-r--r-- | Modules/_sre.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Modules/_sre.c b/Modules/_sre.c index b1258ee..7b941ff 100644 --- a/Modules/_sre.c +++ b/Modules/_sre.c @@ -3401,10 +3401,8 @@ match_groupdict(MatchObject* self, PyObject* args, PyObject* kw) if (!key) goto failed; value = match_getslice(self, key, def); - if (!value) { - Py_DECREF(key); + if (!value) goto failed; - } status = PyDict_SetItem(result, key, value); Py_DECREF(value); if (status < 0) |