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