]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
curl: Fix memory leak in subjectAltName parsing
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 15 Feb 2016 22:33:27 +0000 (00:33 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 15 Feb 2016 22:33:27 +0000 (00:33 +0200)
The parsed data from X509_get_ext_d2i() needs to be freed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/utils/http_curl.c

index bf32ab87a5181c6a4ac85d15251100f19999b80b..9be0111fb369bed200a16b6552c318f4fb6fc4dd 100644 (file)
@@ -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);
 }