From: Victor Stinner Date: Sat, 13 Mar 2010 00:57:22 +0000 (+0000) Subject: sqlite3: Fix _PyUnicode_AsStringAndSize() error handler. X-Git-Tag: v3.2a1~1493 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ff27d6b747b880508cd03aff139419950567c863;p=python sqlite3: Fix _PyUnicode_AsStringAndSize() error handler. Destroy begin_statement (not statement) on error. --- diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c index 5738e2142c..2ce27f53e9 100644 --- a/Modules/_sqlite/connection.c +++ b/Modules/_sqlite/connection.c @@ -1087,7 +1087,7 @@ static int pysqlite_connection_set_isolation_level(pysqlite_Connection* self, Py statement = _PyUnicode_AsStringAndSize(begin_statement, &size); if (!statement) { - Py_DECREF(statement); + Py_DECREF(begin_statement); return -1; } self->begin_statement = PyMem_Malloc(size + 2);