41a6c3
--- a/modules/ssl/ssl_util_stapling.c  2014/05/07 12:51:38 1593001
41a6c3
+++ b/modules/ssl/ssl_util_stapling.c  2014/05/07 12:52:13 1593002
41a6c3
@@ -145,14 +145,15 @@
41a6c3
     X509_digest(x, EVP_sha1(), cinf->idx, NULL);
41a6c3
 
41a6c3
     aia = X509_get1_ocsp(x);
41a6c3
-    if (aia)
41a6c3
+    if (aia) {
41a6c3
         cinf->uri = sk_OPENSSL_STRING_pop(aia);
41a6c3
+        X509_email_free(aia);
41a6c3
+    }
41a6c3
     if (!cinf->uri && !mctx->stapling_force_url) {
41a6c3
         ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, APLOGNO(02218)
41a6c3
                      "ssl_stapling_init_cert: no responder URL");
41a6c3
+        return 0;
41a6c3
     }
41a6c3
-    if (aia)
41a6c3
-        X509_email_free(aia);
41a6c3
     return 1;
41a6c3
 }
41a6c3
 
41a6c3
@@ -403,6 +404,13 @@
41a6c3
     else
41a6c3
         ocspuri = cinf->uri;
41a6c3
 
41a6c3
+    if (!ocspuri) {
41a6c3
+        ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, APLOGNO(02621)
41a6c3
+                     "stapling_renew_response: no uri for responder");
41a6c3
+        rv = FALSE;
41a6c3
+        goto done;
41a6c3
+    }
41a6c3
+
41a6c3
     /* Create a temporary pool to constrain memory use */
41a6c3
     apr_pool_create(&vpool, conn->pool);
41a6c3