diff --git a/src/crypto/x509.c b/src/crypto/x509.c index 18a8cebe..2180173b 100644 --- a/src/crypto/x509.c +++ b/src/crypto/x509.c @@ -1068,6 +1068,7 @@ int x509_certificate ( const void *data, size_t len, /* Parse certificate */ if ( ( rc = x509_parse ( *cert, &cursor ) ) != 0 ) { x509_put ( *cert ); + *cert = NULL; return rc; }