[Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.170,1.171
Jeremy Hylton
jhylton@users.sourceforge.net
Tue, 09 Oct 2001 20:37:08 -0700
- Previous message: [Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.169,1.170
- Next message: [Python-checkins] CVS: python/dist/src/Lib dospath.py,1.24,1.25 macpath.py,1.30,1.31 ntpath.py,1.42,1.43 posixpath.py,1.45,1.46
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv17099
Modified Files:
socketmodule.c
Log Message:
In newSSLObject(), initialize the various members of an SSLObject to NULL.
In SSL_dealloc(), free/dealloc them only if they're non-NULL.
Fixes some obvious core dumps, but not sure yet if there are more
semantics to the SSL calls that would affect the dealloc.
Index: socketmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v
retrieving revision 1.170
retrieving revision 1.171
diff -C2 -d -r1.170 -r1.171
*** socketmodule.c 2001/10/10 03:33:24 1.170
--- socketmodule.c 2001/10/10 03:37:05 1.171
***************
*** 2508,2511 ****
--- 2508,2515 ----
memset(self->server, '\0', sizeof(char) * 256);
memset(self->issuer, '\0', sizeof(char) * 256);
+ self->server_cert = NULL;
+ self->ssl = NULL;
+ self->ctx = NULL;
+ self->Socket = NULL;
self->ctx = SSL_CTX_new(SSLv23_method()); /* Set up context */
***************
*** 2619,2624 ****
if (self->server_cert) /* Possible not to have one? */
X509_free (self->server_cert);
! SSL_free(self->ssl);
! SSL_CTX_free(self->ctx);
Py_XDECREF(self->Socket);
PyObject_Del(self);
--- 2623,2630 ----
if (self->server_cert) /* Possible not to have one? */
X509_free (self->server_cert);
! if (self->ssl)
! SSL_free(self->ssl);
! if (self->ctx)
! SSL_CTX_free(self->ctx);
Py_XDECREF(self->Socket);
PyObject_Del(self);
- Previous message: [Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.169,1.170
- Next message: [Python-checkins] CVS: python/dist/src/Lib dospath.py,1.24,1.25 macpath.py,1.30,1.31 ntpath.py,1.42,1.43 posixpath.py,1.45,1.46
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]