diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2020-05-19 13:39:07 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2020-05-19 13:39:07 +0100 |
commit | 20d46406ed0f5abbca57e13360bec4c17495c999 (patch) | |
tree | fb83abd80fe7708770dae3a1be549d6a1ef6f6e3 | |
parent | 3ab21dbaa4ca855e757002ba1cf0c87da76cbd95 (diff) | |
download | netsurf-20d46406ed0f5abbca57e13360bec4c17495c999.tar.gz netsurf-20d46406ed0f5abbca57e13360bec4c17495c999.tar.bz2 |
about: Rework freeing the san_names structure
AmiSSL's approach to replacing 90% of OpenSSL calls with assembly
means that the official way to pop_free a stack type won't work.
As such, we open-code it here.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
-rw-r--r-- | content/fetchers/about.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/content/fetchers/about.c b/content/fetchers/about.c index b00e59d91..d7c1f7e7e 100644 --- a/content/fetchers/about.c +++ b/content/fetchers/about.c @@ -972,7 +972,17 @@ static nserror san_to_info(X509 *cert, struct ns_cert_san **prev_next) } } } - sk_GENERAL_NAME_pop_free(san_names, GENERAL_NAME_free); + + /* AmiSSL can't cope with the "correct" mechanism of freeing + * the GENERAL_NAME stack, which is: + * sk_GENERAL_NAME_pop_free(san_names, GENERAL_NAME_free); + * So instead we do this open-coded loop which does the same: + */ + for (idx = 0; idx < san_names_nb; idx++) { + GENERAL_NAME *entry = sk_GENERAL_NAME_pop(san_names); + GENERAL_NAME_free(entry); + } + sk_GENERAL_NAME_free(san_names); return NSERROR_OK; } |