1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-12-12 15:41:16 +03:00

server: Fix for loop to free server methods.

Found by Coverity.
This commit is contained in:
Andreas Schneider
2012-10-08 20:20:02 +02:00
parent b8de9e75d0
commit 6352b3d93a

View File

@@ -131,7 +131,7 @@ static int server_set_kex(ssh_session session) {
}
server->methods[i] = strdup(wanted);
if (server->methods[i] == NULL) {
for (j = i - 1; j <= 0; j--) {
for (j = 0; j < i; j++) {
SAFE_FREE(server->methods[j]);
}
return -1;