8000 Address review: check PyLong_FromLong ret value · python/cpython@0067cef · GitHub
[go: up one dir, main page]

Skip to content

Commit 0067cef

Browse files
author
Erlend E. Aasland
committed
Address review: check PyLong_FromLong ret value
1 parent 8d1c138 commit 0067cef

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Modules/_sqlite/connection.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,11 @@ static PyObject *
7777
new_statement_cache(pysqlite_Connection *self, int maxsize)
7878
{
7979
PyObject *args[] = { PyLong_FromLong(maxsize), };
80+
if (args[0] == NULL) {
81+
return NULL;
82+
}
8083
PyObject *inner = PyObject_Vectorcall(_lru_cache, args, 1, NULL);
81-
Py_XDECREF(args[0]);
84+
Py_DECREF(args[0]);
8285
if (inner == NULL) {
8386
return NULL;
8487
}

0 commit comments

Comments
 (0)
0