From: Antoine Pitrou Date: Sat, 12 Jan 2013 20:43:45 +0000 (+0100) Subject: SSLContext.load_dh_params() now properly closes the input file. X-Git-Tag: v3.3.1rc1~370 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=457a2292caf46435ad544f865777a017e71a780a;p=python SSLContext.load_dh_params() now properly closes the input file. --- diff --git a/Misc/NEWS b/Misc/NEWS index 1e4dea2f85..76f71b4425 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -147,6 +147,8 @@ Core and Builtins 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 index ad22c5299c..abb48b976a 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -2177,6 +2177,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) {