mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-12-14 04:18:54 +03:00
server: Fix for loop to free server methods.
Found by Coverity.
This commit is contained in:
@@ -131,7 +131,7 @@ static int server_set_kex(ssh_session session) {
|
|||||||
}
|
}
|
||||||
server->methods[i] = strdup(wanted);
|
server->methods[i] = strdup(wanted);
|
||||||
if (server->methods[i] == NULL) {
|
if (server->methods[i] == NULL) {
|
||||||
for (j = i - 1; j <= 0; j--) {
|
for (j = 0; j < i; j++) {
|
||||||
SAFE_FREE(server->methods[j]);
|
SAFE_FREE(server->methods[j]);
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user