Disable connection-bound for basic-auth
[mod_auth_gssapi.git] / src / mod_auth_gssapi.c
index 9c9b1b2..a88b653 100644 (file)
@@ -323,7 +323,7 @@ static int mag_auth(request_rec *req)
     }
 
     /* implicit auth for subrequests if main auth already happened */
-    if (!ap_is_initial_req(req)) {
+    if (!ap_is_initial_req(req) && req->main != NULL) {
         type = ap_auth_type(req->main);
         if ((type != NULL) && (strcasecmp(type, "GSSAPI") == 0)) {
             /* warn if the subrequest location and the main request
@@ -579,6 +579,10 @@ static int mag_auth(request_rec *req)
         goto done;
     }
     if (auth_type == AUTH_TYPE_BASIC) {
+        if (mc) {
+            apr_pool_cleanup_run(mc->parent, mc, mag_conn_destroy);
+            mc = NULL;
+        }
         while (maj == GSS_S_CONTINUE_NEEDED) {
             gss_release_buffer(&min, &input);
             /* output and input are inverted here, this is intentional */