[Python-checkins] cpython (3.3): SSLContext.load_dh_params() now properly closes the input file.

antoine.pitrou python-checkins at python.org
Sat Jan 12 21:47:14 CET 2013


http://hg.python.org/cpython/rev/523d5b1e3fd5
changeset: 81463:523d5b1e3fd5
branch: 3.3
parent: 81460:778bead39825
user: Antoine Pitrou <solipsis at pitrou.net>
date: Sat Jan 12 21:43:45 2013 +0100
summary:
 SSLContext.load_dh_params() now properly closes the input file.
files:
 Misc/NEWS | 2 ++
 Modules/_ssl.c | 1 +
 2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -147,6 +147,8 @@
 Library
 -------
 
+- SSLContext.load_dh_params() now properly closes the input file.
+
 - Issue #16829: IDLE printing no longer fails if there are spaces or other
 special characters in the file path.
 
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -2177,6 +2177,7 @@
 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) {
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /