summaryrefslogtreecommitdiffstats
path: root/Modules/_ssl.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-05-10 06:57:58 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-05-10 06:57:58 (GMT)
commitc6a989ac3a2ce1f52f48acfb73d04b604ba173b1 (patch)
treebce50037904969634cf2ed60d969829dd0283f95 /Modules/_ssl.c
parentad2ef33245bdd90bf0e80824dbba732b17fdf6b6 (diff)
downloadcpython-c6a989ac3a2ce1f52f48acfb73d04b604ba173b1.zip
cpython-c6a989ac3a2ce1f52f48acfb73d04b604ba173b1.tar.gz
cpython-c6a989ac3a2ce1f52f48acfb73d04b604ba173b1.tar.bz2
Fix problems found by Coverity.
longobject.c: also fix an ssize_t problem <a> could have been NULL, so hoist the size calc to not use <a>. _ssl.c: under fail: self is DECREF'd, but it would have been NULL. _elementtree.c: delete self if there was an error. _csv.c: I'm not sure if lineterminator could have been anything other than a string. However, other string method calls are checked, so check this one too.
Diffstat (limited to 'Modules/_ssl.c')
-rw-r--r--Modules/_ssl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 4c0da6f..afe699b 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -183,9 +183,9 @@ newPySSLObject(PySocketSockObject *Sock, char *key_file, char *cert_file)
int sockstate;
self = PyObject_New(PySSLObject, &PySSL_Type); /* Create new object */
- if (self == NULL){
- errstr = "newPySSLObject error";
- goto fail;
+ if (self == NULL) {
+ PyErr_SetString(PySSLErrorObject, "newPySSLObject error");
+ return NULL;
}
memset(self->server, '\0', sizeof(char) * X509_NAME_MAXLEN);
memset(self->issuer, '\0', sizeof(char) * X509_NAME_MAXLEN);