commit | a9eb38f02a7c0b5540da84cdf94ef4b56bef1716 | [log] [tgz] |
---|---|---|
author | Victor Stinner <victor.stinner@gmail.com> | Thu Oct 31 16:35:38 2013 +0100 |
committer | Victor Stinner <victor.stinner@gmail.com> | Thu Oct 31 16:35:38 2013 +0100 |
tree | 4ae9775b171468e6c2ba3b54a721ae09a7159b48 | |
parent | e75996a77ca1974ffa36f9b7be6cd9d3023c49e7 [diff] |
Issue #19437: Fix newPySSLSocket(), handle PyWeakref_NewRef() failure
diff --git a/Modules/_ssl.c b/Modules/_ssl.c index ffcc4a9..83a271e 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c
@@ -528,6 +528,10 @@ self->socket_type = socket_type; self->Socket = PyWeakref_NewRef((PyObject *) sock, NULL); + if (self->Socket == NULL) { + Py_DECREF(self); + return NULL; + } return self; }