diff options
| author | tb <> | 2020-09-21 05:20:20 +0000 |
|---|---|---|
| committer | tb <> | 2020-09-21 05:20:20 +0000 |
| commit | e61b320e8d19af9d30c2c97c456cf47cf857c241 (patch) | |
| tree | a678791b3ec5d49449368518f8b0629999648ed0 | |
| parent | 997a143ecd162f797e525fdea4a0e42c1c73c939 (diff) | |
| download | openbsd-e61b320e8d19af9d30c2c97c456cf47cf857c241.tar.gz openbsd-e61b320e8d19af9d30c2c97c456cf47cf857c241.tar.bz2 openbsd-e61b320e8d19af9d30c2c97c456cf47cf857c241.zip | |
Move freeing and zeroing up to right after the while loop.
Requested by jsing
| -rw-r--r-- | src/lib/libcrypto/x509/x509_constraints.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libcrypto/x509/x509_constraints.c b/src/lib/libcrypto/x509/x509_constraints.c index f50a55c6ac..caf56af045 100644 --- a/src/lib/libcrypto/x509/x509_constraints.c +++ b/src/lib/libcrypto/x509/x509_constraints.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x509_constraints.c,v 1.8 2020/09/20 19:13:06 tb Exp $ */ | 1 | /* $OpenBSD: x509_constraints.c,v 1.9 2020/09/21 05:20:20 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2020 Bob Beck <beck@openbsd.org> | 3 | * Copyright (c) 2020 Bob Beck <beck@openbsd.org> |
| 4 | * | 4 | * |
| @@ -767,14 +767,14 @@ x509_constraints_extract_names(struct x509_constraints_names *names, | |||
| 767 | } | 767 | } |
| 768 | vname = NULL; | 768 | vname = NULL; |
| 769 | } | 769 | } |
| 770 | |||
| 771 | x509_constraints_name_free(vname); | ||
| 772 | vname = NULL; | ||
| 773 | |||
| 770 | subject_name = X509_get_subject_name(cert); | 774 | subject_name = X509_get_subject_name(cert); |
| 771 | if (X509_NAME_entry_count(subject_name) > 0) { | 775 | if (X509_NAME_entry_count(subject_name) > 0) { |
| 772 | X509_NAME_ENTRY *email; | 776 | X509_NAME_ENTRY *email; |
| 773 | X509_NAME_ENTRY *cn; | 777 | X509_NAME_ENTRY *cn; |
| 774 | |||
| 775 | x509_constraints_name_free(vname); | ||
| 776 | vname = NULL; | ||
| 777 | |||
| 778 | /* | 778 | /* |
| 779 | * This cert has a non-empty subject, so we must add | 779 | * This cert has a non-empty subject, so we must add |
| 780 | * the subject as a dirname to be compared against | 780 | * the subject as a dirname to be compared against |
