]> granicus.if.org Git - python/commitdiff
Moved DECREF to correct place to get rid of leaked references.
authorGerhard Häring <gh@ghaering.de>
Sat, 29 Mar 2008 14:11:55 +0000 (14:11 +0000)
committerGerhard Häring <gh@ghaering.de>
Sat, 29 Mar 2008 14:11:55 +0000 (14:11 +0000)
Modules/_sqlite/cursor.c

index 7fd7db31ee4c96569454001ffd6b76b43c7589c4..8efa8127195aa6fee8c99b7cde0b6855b4a50757 100644 (file)
@@ -355,9 +355,9 @@ PyObject* _pysqlite_fetch_one_row(pysqlite_Cursor* self)
                             error_obj = PyUnicode_FromEncodedObject(buf_bytes, "ascii", "replace");
                             if (!error_obj) {
                                 PyErr_SetString(pysqlite_OperationalError, "Could not decode to UTF-8");
-                                Py_DECREF(error_obj);
                             } else {
                                 PyErr_SetObject(pysqlite_OperationalError, error_obj);
+                                Py_DECREF(error_obj);
                             }
                             Py_DECREF(buf_bytes);
                         }