diff options
author | Benjamin Peterson <benjamin@python.org> | 2015-11-14 23:12:18 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2015-11-14 23:12:18 (GMT) |
commit | c591936789f4979c7e3f20eeacfebc6c3a7886bf (patch) | |
tree | 23be1405d5388433d9bc04dd6298ed0fd88d674f /Modules/_ssl.c | |
parent | 5d7d26c403d86e9525820d872eb3e331dbc31750 (diff) | |
download | cpython-c591936789f4979c7e3f20eeacfebc6c3a7886bf.zip cpython-c591936789f4979c7e3f20eeacfebc6c3a7886bf.tar.gz cpython-c591936789f4979c7e3f20eeacfebc6c3a7886bf.tar.bz2 |
fix possible memory lea k in _get_aia_uri (closes #25578)
Diffstat (limited to 'Modules/_ssl.c')
-rw-r--r-- | Modules/_ssl.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c index c9c556e..55159d7 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -965,7 +965,10 @@ _get_aia_uri(X509 *certificate, int nid) { AUTHORITY_INFO_ACCESS *info; info = X509_get_ext_d2i(certificate, NID_info_access, NULL, NULL); - if ((info == NULL) || (sk_ACCESS_DESCRIPTION_num(info) == 0)) { + if (info == NULL) + return Py_None; + if (sk_ACCESS_DESCRIPTION_num(info) == 0) { + AUTHORITY_INFO_ACCESS_free(info); return Py_None; } |