aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorCedric Izoard <Cedric.Izoard@ceva-dsp.com>2016-06-14 12:49:00 (GMT)
committerJouni Malinen <j@w1.fi>2016-06-19 19:11:36 (GMT)
commit04c18fa04b3273128a9d96fff37ec4d70c42446f (patch)
treeb9024fee9efa016d1ec61bc9ae2c022a00283942 /src/utils
parent1f7cd73ca65adef20639ad829591eac6ec2ff010 (diff)
downloadhostap-04c18fa04b3273128a9d96fff37ec4d70c42446f.zip
hostap-04c18fa04b3273128a9d96fff37ec4d70c42446f.tar.gz
hostap-04c18fa04b3273128a9d96fff37ec4d70c42446f.tar.bz2
curl: Don't free memory for subjectAltName before calling callback
Freeing memory for subjectAltName in parse_cert(), will give cert_cb pointers to freed memory zone that may already been overwritten. Memory for subjectAltName is released in parse_cert_free(). Signed-off-by: Cedric Izoard <cedric.izoard@ceva-dsp.com>
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/http_curl.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/utils/http_curl.c b/src/utils/http_curl.c
index d594398..a06aae8 100644
--- a/src/utils/http_curl.c
+++ b/src/utils/http_curl.c
@@ -857,10 +857,8 @@ 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);
}