diff options
author | Eduardo Chappa <chappa@washington.edu> | 2018-05-13 01:38:56 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2018-05-13 01:38:56 -0600 |
commit | aac7b10863bcfabe936feb5151e7e11123e13306 (patch) | |
tree | 8033a31daed6c94fcbdd41eef1682ba0539cfabd /imap/src/osdep/unix/ssl_unix.c | |
parent | 400647dcc1b040f82d22d539fc013f5e23132049 (diff) | |
download | alpine-aac7b10863bcfabe936feb5151e7e11123e13306.tar.xz |
* More changes to make Valgrind happy. Work in progress.
Diffstat (limited to 'imap/src/osdep/unix/ssl_unix.c')
-rw-r--r-- | imap/src/osdep/unix/ssl_unix.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/imap/src/osdep/unix/ssl_unix.c b/imap/src/osdep/unix/ssl_unix.c index 4c4d6ef8..ea2df896 100644 --- a/imap/src/osdep/unix/ssl_unix.c +++ b/imap/src/osdep/unix/ssl_unix.c @@ -404,12 +404,14 @@ static char *ssl_validate_cert (X509 *cert,char *host) "Server name does not match certificate"; /* if mismatch, see if in extensions */ if (ret && (ext = X509_get_ext_d2i (cert,NID_subject_alt_name,NIL,NIL)) && - (n = sk_GENERAL_NAME_num (ext))) + (n = sk_GENERAL_NAME_num (ext))){ /* older versions of OpenSSL use "ia5" instead of dNSName */ for (i = 0; ret && (i < n); i++) if ((name = sk_GENERAL_NAME_value (ext,i)) && (name->type = GEN_DNS) && (s = name->d.ia5->data) && ssl_compare_hostnames (host,s)) ret = NIL; + sk_GENERAL_NAME_pop_free(ext, GENERAL_NAME_free); + } } else ret = "Unable to locate common name in certificate"; return ret; |