]> granicus.if.org Git - apache/commitdiff
Add cleanup for SSLProxyMachineCertificateChainFile during init
authorDaniel Ruggeri <druggeri@apache.org>
Wed, 8 Feb 2012 21:02:20 +0000 (21:02 +0000)
committerDaniel Ruggeri <druggeri@apache.org>
Wed, 8 Feb 2012 21:02:20 +0000 (21:02 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1242089 13f79535-47bb-0310-9956-ffa450edef68

modules/ssl/ssl_engine_init.c

index 98ba6a240ed8424fc80d69f7d15752cf4ba53803..acaf5d5077fcd1496ee6fd773bbb077dc7a416b9 100644 (file)
@@ -1636,6 +1636,17 @@ static void ssl_init_ctx_cleanup_proxy(modssl_ctx_t *mctx)
     ssl_init_ctx_cleanup(mctx);
 
     if (mctx->pkp->certs) {
+        int i = 0;
+        int ncerts = sk_X509_INFO_num(mctx->pkp->certs);
+
+        if (mctx->pkp->ca_certs) {
+            for (i = 0; i < ncerts; i++) {
+                if (mctx->pkp->ca_certs[i] != NULL) {
+                    sk_X509_pop_free(mctx->pkp->ca_certs[i], X509_free);
+                }
+            }
+        }
+
         sk_X509_INFO_pop_free(mctx->pkp->certs, X509_INFO_free);
         mctx->pkp->certs = NULL;
     }