mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 18:50:28 +09:00
kex: Check allocation result
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
8e211c0689
commit
4b298ca770
@@ -662,6 +662,10 @@ int ssh_set_client_kex(ssh_session session){
|
|||||||
if (wanted == NULL)
|
if (wanted == NULL)
|
||||||
wanted = default_methods[i];
|
wanted = default_methods[i];
|
||||||
client->methods[i] = strdup(wanted);
|
client->methods[i] = strdup(wanted);
|
||||||
|
if (client->methods[i] == NULL) {
|
||||||
|
ssh_set_error_oom(session);
|
||||||
|
return SSH_ERROR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return SSH_OK;
|
return SSH_OK;
|
||||||
|
|||||||
Reference in New Issue
Block a user