diff options
Diffstat (limited to 'lib/x509/pkcs7.c')
-rw-r--r-- | lib/x509/pkcs7.c | 5 |
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 */ |