SSLContext.load_dh_params() now properly closes the input file.

This commit is contained in:
Antoine Pitrou 2013-01-12 21:44:33 +01:00
commit 1e37e9efa9
2 changed files with 3 additions and 0 deletions

View file

@ -2248,6 +2248,7 @@ load_dh_params(PySSLContext *self, PyObject *filepath)
errno = 0;
PySSL_BEGIN_ALLOW_THREADS
dh = PEM_read_DHparams(f, NULL, NULL, NULL);
fclose(f);
PySSL_END_ALLOW_THREADS
if (dh == NULL) {
if (errno != 0) {