diff options
author | Simo Sorce <simo@redhat.com> | 2015-03-10 17:14:33 -0400 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2015-03-10 17:20:44 -0400 |
commit | 1fc49992c107bd3830921a8198929a936e8b7fb2 (patch) | |
tree | 7598a9b03f99803b5598dda076215982a25ed747 | |
parent | 3effbe272147674cf92c13b387373a60f2cbbacf (diff) | |
download | mod_auth_gssapi-1fc49992c107bd3830921a8198929a936e8b7fb2.tar.gz mod_auth_gssapi-1fc49992c107bd3830921a8198929a936e8b7fb2.tar.xz mod_auth_gssapi-1fc49992c107bd3830921a8198929a936e8b7fb2.zip |
Do not free orig_ccache
It realy is const memory referenced internally by MIT's gssapi.
Freeing it will cause a segfault on the next invocation.
This memory is kept in thread local storage and freed by gssapi itself
as needed.
Fixes #11
-rw-r--r-- | src/mod_auth_gssapi.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/mod_auth_gssapi.c b/src/mod_auth_gssapi.c index db87c10..b5e6a2e 100644 --- a/src/mod_auth_gssapi.c +++ b/src/mod_auth_gssapi.c @@ -185,7 +185,7 @@ static int mag_auth(request_rec *req) gss_name_t server = GSS_C_NO_NAME; #ifdef HAVE_GSS_KRB5_CCACHE_NAME const char *user_ccache = NULL; - char *orig_ccache = NULL; + const char *orig_ccache = NULL; #endif type = ap_auth_type(req); @@ -301,8 +301,7 @@ static int mag_auth(request_rec *req) goto done; } user_ccache = apr_psprintf(req->pool, "MEMORY:user_%qu", rndname); - maj = gss_krb5_ccache_name(&min, user_ccache, - (const char **)&orig_ccache); + maj = gss_krb5_ccache_name(&min, user_ccache, &orig_ccache); if (GSS_ERROR(maj)) { ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, req, "In Basic Auth, %s", @@ -516,8 +515,6 @@ done: "failed", maj, min)); } } - free(orig_ccache); - orig_ccache = NULL; #endif gss_delete_sec_context(&min, &user_ctx, &output); gss_release_cred(&min, &user_cred); |