You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by jf...@apache.org on 2018/11/14 20:37:35 UTC

svn commit: r1846606 - /tomcat/native/trunk/native/src/sslutils.c

Author: jfclere
Date: Wed Nov 14 20:37:35 2018
New Revision: 1846606

URL: http://svn.apache.org/viewvc?rev=1846606&view=rev
Log:
remove sk_OCSP_CERTID_free() related logic, the free is done in OCSP_REQUEST_free().

Modified:
    tomcat/native/trunk/native/src/sslutils.c

Modified: tomcat/native/trunk/native/src/sslutils.c
URL: http://svn.apache.org/viewvc/tomcat/native/trunk/native/src/sslutils.c?rev=1846606&r1=1846605&r2=1846606&view=diff
==============================================================================
--- tomcat/native/trunk/native/src/sslutils.c (original)
+++ tomcat/native/trunk/native/src/sslutils.c Wed Nov 14 20:37:35 2018
@@ -723,8 +723,7 @@ static char **decode_OCSP_url(ASN1_OCTET
 
 
 /* stolen from openssl ocsp command */
-static int add_ocsp_cert(OCSP_REQUEST *req, X509 *cert, X509 *issuer,
-                         STACK_OF(OCSP_CERTID) *ids)
+static int add_ocsp_cert(OCSP_REQUEST *req, X509 *cert, X509 *issuer)
 {
     OCSP_CERTID *id;
 
@@ -737,7 +736,7 @@ static int add_ocsp_cert(OCSP_REQUEST *r
         OCSP_CERTID_free(id);
         return 0;
     } else {
-        sk_OCSP_CERTID_push(ids, id);
+        /* id will be freed by OCSP_REQUEST_free() */
         return 1;
     }
 }
@@ -964,7 +963,6 @@ static OCSP_RESPONSE *get_ocsp_response(
     BIO *bio_req;
     char *hostname, *path, *c_port;
     int port, use_ssl;
-    STACK_OF(OCSP_CERTID) *ids = NULL;
     int ok = 0;
     apr_socket_t *apr_sock = NULL;
     apr_pool_t *mp;
@@ -980,8 +978,7 @@ static OCSP_RESPONSE *get_ocsp_response(
     if (ocsp_req == NULL)
         goto end;
 
-    ids = sk_OCSP_CERTID_new_null();
-    if (add_ocsp_cert(ocsp_req,cert,issuer,ids) == 0 )
+    if (add_ocsp_cert(ocsp_req,cert,issuer) == 0 )
         goto free_req;
 
     /* create the BIO with the request to send */
@@ -1008,7 +1005,6 @@ free_bio:
 
 free_req:
     OCSP_REQUEST_free(ocsp_req);
-    sk_OCSP_CERTID_free(ids);
 
 end:
     OPENSSL_free(hostname);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org