mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Issue #19437: Fix newPySSLSocket(), handle PyWeakref_NewRef() failure
This commit is contained in:
parent
e75996a77c
commit
a9eb38f02a
1 changed files with 4 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue