aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2016-02-15 22:33:27 (GMT)
committerJouni Malinen <j@w1.fi>2016-02-15 22:33:27 (GMT)
commite60913b6002bcd2eced2c30b25495d24b66e4496 (patch)
tree2e1709a7ca245fa6b8e176cabd8a4a0f9389101b /src/utils
parent6014890bfb54011217cce97f66d48d27575f74e6 (diff)
downloadhostap-e60913b6002bcd2eced2c30b25495d24b66e4496.zip
hostap-e60913b6002bcd2eced2c30b25495d24b66e4496.tar.gz
hostap-e60913b6002bcd2eced2c30b25495d24b66e4496.tar.bz2
curl: Fix memory leak in subjectAltName parsing
The parsed data from X509_get_ext_d2i() needs to be freed. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/http_curl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/utils/http_curl.c b/src/utils/http_curl.c
index bf32ab8..9be0111 100644
--- a/src/utils/http_curl.c
+++ b/src/utils/http_curl.c
@@ -857,8 +857,10 @@ static void parse_cert(struct http_ctx *ctx, struct http_cert *hcert,
os_memset(hcert, 0, sizeof(*hcert));
*names = X509_get_ext_d2i(cert, NID_subject_alt_name, NULL, NULL);
- if (*names)
+ if (*names) {
add_alt_names(ctx, hcert, *names);
+ sk_GENERAL_NAME_pop_free(*names, GENERAL_NAME_free);
+ }
add_logotype_ext(ctx, hcert, cert);
}