aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2012-10-08 20:20:02 +0200
committerAndreas Schneider <asn@cryptomilk.org>2012-10-12 08:06:55 +0200
commit6352b3d93a6329990f3eeb250e35cb9c602a2a3a (patch)
tree4a571299e7be29bcfbedb772667b8695b0fe28e4 /src
parentb8de9e75d02c20f0603771074e5f40ddf90f4f99 (diff)
downloadlibssh-6352b3d93a6329990f3eeb250e35cb9c602a2a3a.tar.gz
libssh-6352b3d93a6329990f3eeb250e35cb9c602a2a3a.tar.xz
libssh-6352b3d93a6329990f3eeb250e35cb9c602a2a3a.zip
server: Fix for loop to free server methods.
Found by Coverity.
Diffstat (limited to 'src')
-rw-r--r--src/server.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/server.c b/src/server.c
index 582bb48a..5089bd0e 100644
--- a/src/server.c
+++ b/src/server.c
@@ -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;