Fix X509_STORE_CTX_cleanup()
[openssl.git] / crypto / ts / ts_rsp_verify.c
index c79db38ab98289c252d87ff67c457e5ea11a399d..c03f6aced229bda4e0612a93f23c09a3dbf9f622 100644 (file)
@@ -217,7 +217,8 @@ static int ts_verify_cert(X509_STORE *store, STACK_OF(X509) *untrusted,
     int ret = 1;
 
     *chain = NULL;
-    X509_STORE_CTX_init(&cert_ctx, store, signer, untrusted);
+    if (!X509_STORE_CTX_init(&cert_ctx, store, signer, untrusted))
+        return 0;
     X509_STORE_CTX_set_purpose(&cert_ctx, X509_PURPOSE_TIMESTAMP_SIGN);
     i = X509_verify_cert(&cert_ctx);
     if (i <= 0) {