From 73b3ac4b98967cc77181be15a8e3f4a41f4b8966 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 14 Oct 2013 17:30:22 +0200 Subject: Fix resource leak in gpm_accept_sec_context(). Resolves Coverity CID #12027. --- proxy/src/client/gpm_accept_sec_context.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/proxy/src/client/gpm_accept_sec_context.c b/proxy/src/client/gpm_accept_sec_context.c index d94c001..5f8fb06 100644 --- a/proxy/src/client/gpm_accept_sec_context.c +++ b/proxy/src/client/gpm_accept_sec_context.c @@ -80,6 +80,14 @@ OM_uint32 gpm_accept_sec_context(OM_uint32 *minor_status, } /* return values */ + if (res->status.major_status) { + gpm_save_status(&res->status); + ret_maj = res->status.major_status; + *minor_status = res->status.minor_status; + ret = 0; + goto done; + } + if (mech_type) { if (res->status.mech.octet_string_len) { ret = gp_conv_gssx_to_oid_alloc(&res->status.mech, &mech); @@ -89,14 +97,6 @@ OM_uint32 gpm_accept_sec_context(OM_uint32 *minor_status, } } - if (res->status.major_status) { - gpm_save_status(&res->status); - ret_maj = res->status.major_status; - *minor_status = res->status.minor_status; - ret = 0; - goto done; - } - if (res->context_handle) { ctx = res->context_handle; /* we are stealing the delegated creds on success, so we do not want -- cgit