Commit ed70129e authored by neonene's avatar neonene Committed by Steve Dower

bpo-37702: Fix SSL's certificate-store leak on Windows (GH-15632)

ssl_collect_certificates function in _ssl.c has a memory leak.
Calling CertOpenStore() and CertAddStoreToCollection(), a store's refcnt gets incremented by 2.
But CertCloseStore() is called only once and the refcnt leaves 1.
parent b4612f5d
Fix memory leak on Windows in creating an SSLContext object or
running urllib.request.urlopen('https://...').
\ No newline at end of file
......@@ -5581,6 +5581,7 @@ ssl_collect_certificates(const char *store_name)
if (result) {
++storesAdded;
}
CertCloseStore(hSystemStore, 0); /* flag must be 0 */
}
}
if (storesAdded == 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment