gssapi: Check return value from ssh_gssapi_init()

Checking the session->gssapi is resulting in the very same results, but this
approach is more direct and makes static analysis tools more happy.

Thanks coverity!

CID 1644000

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:18:23 +01:00
parent 3f0007895c
commit f5eb3e532b

View File

@@ -616,12 +616,14 @@ ssh_gssapi_creds ssh_gssapi_get_creds(ssh_session session)
*/ */
void ssh_gssapi_set_creds(ssh_session session, const ssh_gssapi_creds creds) void ssh_gssapi_set_creds(ssh_session session, const ssh_gssapi_creds creds)
{ {
int rc;
if (session == NULL) { if (session == NULL) {
return; return;
} }
if (session->gssapi == NULL) { if (session->gssapi == NULL) {
ssh_gssapi_init(session); rc = ssh_gssapi_init(session);
if (session->gssapi == NULL) { if (rc == SSH_ERROR) {
return; return;
} }
} }