]> granicus.if.org Git - python/commitdiff
Repair refleaks in unicodeobject.
authorGeorg Brandl <georg@python.org>
Sun, 4 Jun 2006 21:46:16 +0000 (21:46 +0000)
committerGeorg Brandl <georg@python.org>
Sun, 4 Jun 2006 21:46:16 +0000 (21:46 +0000)
Objects/unicodeobject.c

index eb5bdd8458c755e4065750b6df4d38ebbf7778a4..970e69f22736beff7fb4b461f8955302908c88cb 100644 (file)
@@ -3194,6 +3194,8 @@ PyUnicode_BuildEncodingMap(PyObject* string)
                 goto failed1;
             if (PyDict_SetItem(result, key, value) == -1)
                 goto failed1;
+            Py_DECREF(key);
+            Py_DECREF(value);
         }
         return result;
       failed1:
@@ -3389,6 +3391,7 @@ charmapencode_result charmapencode_output(Py_UNICODE c, PyObject *mapping,
            *outpos += repsize;
        }
     }
+    Py_DECREF(rep);
     return enc_SUCCESS;
 }