mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09:00
Add error checking for strdup.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@344 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
@@ -293,8 +293,13 @@ int set_kex(SSH_SESSION *session){
|
|||||||
leave_function();
|
leave_function();
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
if(i>=SSH_LANG_C_S && !client->methods[i])
|
if ((i >= SSH_LANG_C_S) && (client->methods[i] == NULL)) {
|
||||||
client->methods[i]=strdup(""); // we can safely do that for languages
|
/* we can safely do that for languages */
|
||||||
|
client->methods[i] = strdup("");
|
||||||
|
if (client->methods[i] == NULL) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
leave_function();
|
leave_function();
|
||||||
|
|||||||
Reference in New Issue
Block a user