gssapi: Avoid possible memory leak on error condition

Thanks coverity!

CID 1643999

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2026-01-07 13:20:29 +01:00
parent f5eb3e532b
commit 48fdf4b80a

View File

@@ -1405,10 +1405,10 @@ SSH_PACKET_CALLBACK(ssh_packet_userauth_gssapi_token_client)
input_token.value = ssh_string_data(token); input_token.value = ssh_string_data(token);
maj_stat = maj_stat =
ssh_gssapi_init_ctx(session->gssapi, &input_token, &output_token, NULL); ssh_gssapi_init_ctx(session->gssapi, &input_token, &output_token, NULL);
SSH_STRING_FREE(token);
if (GSS_ERROR(maj_stat)) { if (GSS_ERROR(maj_stat)) {
goto error; goto error;
} }
SSH_STRING_FREE(token);
if (output_token.length != 0) { if (output_token.length != 0) {
hexa = ssh_get_hexa(output_token.value, output_token.length); hexa = ssh_get_hexa(output_token.value, output_token.length);