if (mc) {
/* register the context in the memory pool, so it can be freed
* when the connection/request is terminated */
- apr_pool_userdata_set(mc, "mag_conn_ptr",
- mag_conn_destroy, mc->parent);
+ apr_pool_cleanup_register(mc->parent, (void *) mc,
+ mag_conn_destroy, apr_pool_cleanup_null);
if (mc->established && !auth_header) {
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, req,
"Already established context found!");
mag_set_req_data(req, cfg, mc);
+ ret = OK;
+ goto done;
}
pctx = &mc->ctx;
} else {
"Mechanism needs continuation but neither "
"GssapiConnectionBound nor "
"GssapiUseSessions are available");
- gss_delete_sec_context(&min, pctx, GSS_C_NO_BUFFER);
gss_release_buffer(&min, &output);
output.length = 0;
}
}
}
#endif
- gss_delete_sec_context(&min, &user_ctx, &output);
+ if (ctx != GSS_C_NO_CONTEXT)
+ gss_delete_sec_context(&min, &ctx, GSS_C_NO_BUFFER);
+ gss_delete_sec_context(&min, &user_ctx, GSS_C_NO_BUFFER);
gss_release_cred(&min, &user_cred);
gss_release_cred(&min, &acquired_cred);
gss_release_cred(&min, &delegated_cred);