[Python-checkins] cpython (merge 3.4 -> 3.5): merge 3.4 (#27774)

benjamin.peterson python-checkins at python.org
Tue Aug 16 01:05:28 EDT 2016


https://hg.python.org/cpython/rev/424cb9482974
changeset:   102691:424cb9482974
branch:      3.5
parent:      102686:98c86d5a6655
parent:      102690:2e404ac88e0e
user:        Benjamin Peterson <benjamin at python.org>
date:        Mon Aug 15 22:05:06 2016 -0700
summary:
  merge 3.4 (#27774)

files:
  Misc/NEWS      |  2 ++
  Modules/_sre.c |  4 +---
  2 files changed, 3 insertions(+), 3 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -42,6 +42,8 @@
 - 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
--- a/Modules/_sre.c
+++ b/Modules/_sre.c
@@ -2196,10 +2196,8 @@
         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)

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list