OpenSSL: Fix memory leak in TOD policy validation

Returned policies from X509_get_ext_d2i() need to be freed.

Fixes: 21f1a1e66c ("Report TOD policy")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Jouni Malinen 2020-01-07 20:40:12 +02:00 committed by Jouni Malinen
parent 8296ee1805
commit 297d69161b

View File

@ -2190,6 +2190,7 @@ static int openssl_cert_tod(X509 *cert)
else if (os_strcmp(buf, "1.3.6.1.4.1.40808.1.3.2") == 0 && !tod)
tod = 2; /* TOD-TOFU */
}
sk_POLICYINFO_pop_free(ext, POLICYINFO_free);
return tod;
}