mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-02-12 07:10:33 +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 *
|
static PyObject *
|
||||||
xid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
|
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);
|
Py_INCREF(Py_None);
|
||||||
self->format_id = Py_None;
|
self->format_id = Py_None;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user