mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-02-07 12:50:32 +03:00
Guard from NULL dereference if Xid allocation fails
This commit is contained in:
parent
31812c01e6
commit
18085201c8
|
@ -78,7 +78,9 @@ static PyMemberDef xid_members[] = {
|
|||
static PyObject *
|
||||
xid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
XidObject *self = (XidObject *)type->tp_alloc(type, 0);
|
||||
XidObject *self;
|
||||
|
||||
if (!(self = (XidObject *)type->tp_alloc(type, 0))) { return NULL; }
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
self->format_id = Py_None;
|
||||
|
|
Loading…
Reference in New Issue
Block a user