diff options
author | tb <> | 2021-04-05 07:02:50 +0000 |
---|---|---|
committer | tb <> | 2021-04-05 07:02:50 +0000 |
commit | c6687d35502cbe2f35c39eb4335a7e5a55d93807 (patch) | |
tree | 3f0d45b745fcd0af146bd7b4e01c204bf8add2ca | |
parent | 82b9607cca567f19abcdd8aa6a15fba2cc0106c3 (diff) | |
download | openbsd-c6687d35502cbe2f35c39eb4335a7e5a55d93807.tar.gz openbsd-c6687d35502cbe2f35c39eb4335a7e5a55d93807.tar.bz2 openbsd-c6687d35502cbe2f35c39eb4335a7e5a55d93807.zip |
Don't leak param->name in x509_verify_param_zero()
For dynamically allocated verify parameters, param->name is only ever set
in X509_VERIFY_set1_name() where the old one is freed and the new one is
assigned via strdup(). Setting it to NULL without freeing it beforehand is
a leak.
looks correct to millert, ok inoguchi
-rw-r--r-- | src/lib/libcrypto/x509/x509_vpm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/libcrypto/x509/x509_vpm.c b/src/lib/libcrypto/x509/x509_vpm.c index 9fb94b2772..5133a82b0b 100644 --- a/src/lib/libcrypto/x509/x509_vpm.c +++ b/src/lib/libcrypto/x509/x509_vpm.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_vpm.c,v 1.23 2020/12/16 13:44:17 tb Exp $ */ | 1 | /* $OpenBSD: x509_vpm.c,v 1.24 2021/04/05 07:02:50 tb Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2004. | 3 | * project 2004. |
4 | */ | 4 | */ |
@@ -172,6 +172,7 @@ x509_verify_param_zero(X509_VERIFY_PARAM *param) | |||
172 | X509_VERIFY_PARAM_ID *paramid; | 172 | X509_VERIFY_PARAM_ID *paramid; |
173 | if (!param) | 173 | if (!param) |
174 | return; | 174 | return; |
175 | free(param->name); | ||
175 | param->name = NULL; | 176 | param->name = NULL; |
176 | param->purpose = 0; | 177 | param->purpose = 0; |
177 | param->trust = 0; | 178 | param->trust = 0; |