Commit 1db400ad authored by Victor Stinner's avatar Victor Stinner

Issue #19437: Fix newPySSLSocket(), handle PyWeakref_NewRef() failure

parent eda77c22
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment