mirror of https://github.com/python/cpython
Issue #19437: Fix newPySSLSocket(), handle PyWeakref_NewRef() failure
This commit is contained in:
parent
e75996a77c
commit
a9eb38f02a
|
@ -528,6 +528,10 @@ newPySSLSocket(PySSLContext *sslctx, PySocketSockObject *sock,
|
|||
|
||||
self->socket_type = socket_type;
|
||||
self->Socket = PyWeakref_NewRef((PyObject *) sock, NULL);
|
||||
if (self->Socket == NULL) {
|
||||
Py_DECREF(self);
|
||||
return NULL;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue