summaryrefslogtreecommitdiff
path: root/lib/x509/pkcs7.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/x509/pkcs7.c')
-rw-r--r--lib/x509/pkcs7.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/x509/pkcs7.c b/lib/x509/pkcs7.c
index 295ebe0cdd..dbdd2cb585 100644
--- a/lib/x509/pkcs7.c
+++ b/lib/x509/pkcs7.c
@@ -1323,8 +1323,11 @@ gnutls_x509_crt_t find_signer(gnutls_pkcs7_t pkcs7, gnutls_x509_trust_list_t tl,
issuer = find_verified_issuer_of(pkcs7, issuer, purpose, vflags);
- if (issuer != NULL && gnutls_x509_crt_check_issuer(issuer, issuer))
+ if (issuer != NULL && gnutls_x509_crt_check_issuer(issuer, issuer)) {
+ if (prev) gnutls_x509_crt_deinit(prev);
+ prev = issuer;
break;
+ }
} while(issuer != NULL);
issuer = prev; /* the last we have seen */