diff options
| author | Simo Sorce <simo@redhat.com> | 2012-08-14 15:14:15 +0200 |
|---|---|---|
| committer | Simo Sorce <simo@redhat.com> | 2012-09-13 16:18:11 -0400 |
| commit | 352f617373388d9c05b560da3cece91e824a637a (patch) | |
| tree | 85d8efffbfab361b377882cd799611ba99df0d7c /src | |
| parent | 7f8f693a439810569bd869c7b3975f9dd03f4d43 (diff) | |
| download | krb5-352f617373388d9c05b560da3cece91e824a637a.tar.gz krb5-352f617373388d9c05b560da3cece91e824a637a.tar.xz krb5-352f617373388d9c05b560da3cece91e824a637a.zip | |
Avoid memory leaks on error condition
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/gssapi/mechglue/g_accept_sec_context.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/gssapi/mechglue/g_accept_sec_context.c b/src/lib/gssapi/mechglue/g_accept_sec_context.c index f6afc4517e..85e41d3101 100644 --- a/src/lib/gssapi/mechglue/g_accept_sec_context.c +++ b/src/lib/gssapi/mechglue/g_accept_sec_context.c @@ -236,12 +236,10 @@ gss_cred_id_t * d_cred; &temp_minor_status, mech, internal_name, &tmp_src_name); if (temp_status != GSS_S_COMPLETE) { + status = temp_status; *minor_status = temp_minor_status; map_error(minor_status, mech); - if (output_token->length) - (void) gss_release_buffer(&temp_minor_status, - output_token); - return (temp_status); + goto error_out; } *src_name = tmp_src_name; } else @@ -329,6 +327,9 @@ error_out: (void) gss_release_buffer(&temp_minor_status, (gss_buffer_t)tmp_src_name); + if (output_token->length) + (void) gss_release_buffer(&temp_minor_status, output_token); + return (status); } #endif /* LEAN_CLIENT */ |
