mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-01-31 17:34:08 +03:00
Added error check in _mogrify for failed tuple creation
This commit is contained in:
parent
0ee641361b
commit
efee049338
|
@ -217,7 +217,10 @@ _mogrify(PyObject *var, PyObject *fmt, cursorObject *curs, PyObject **new)
|
|||
}
|
||||
|
||||
if (n == NULL) {
|
||||
n = PyTuple_New(PyObject_Length(var));
|
||||
if (!(n = PyTuple_New(PyObject_Length(var)))) {
|
||||
Py_DECREF(value);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* let's have d point just after the '%' */
|
||||
|
|
Loading…
Reference in New Issue
Block a user