summaryrefslogtreecommitdiffstats
path: root/proxy/src/client/gpm_init_sec_context.c
diff options
context:
space:
mode:
Diffstat (limited to 'proxy/src/client/gpm_init_sec_context.c')
-rw-r--r--proxy/src/client/gpm_init_sec_context.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/proxy/src/client/gpm_init_sec_context.c b/proxy/src/client/gpm_init_sec_context.c
index bd88055..14c65e4 100644
--- a/proxy/src/client/gpm_init_sec_context.c
+++ b/proxy/src/client/gpm_init_sec_context.c
@@ -137,12 +137,6 @@ done:
gpm_free_xdrs(GSSX_INIT_SEC_CONTEXT, &uarg, &ures);
if (ret_maj == GSS_S_COMPLETE || ret_maj == GSS_S_CONTINUE_NEEDED) {
- /* replace old ctx handle if any */
- if (*context_handle) {
- xdr_free((xdrproc_t)xdr_gssx_ctx, (char *)*context_handle);
- free(*context_handle);
- }
- *context_handle = ctx;
if (actual_mech_type) {
*actual_mech_type = mech;
}
@@ -171,6 +165,13 @@ done:
}
}
+ /* always replace old ctx handle and set new */
+ if (*context_handle) {
+ xdr_free((xdrproc_t)xdr_gssx_ctx, (char *)*context_handle);
+ free(*context_handle);
+ }
+ *context_handle = ctx;
+
*minor_status = ret_min;
return ret_maj;
}