summaryrefslogtreecommitdiff
path: root/clientloop.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2015-02-25 19:54:02 +0000
committerDamien Miller <djm@mindrot.org>2015-02-26 10:09:58 +1100
commita63cfa26864b93ab6afefad0b630e5358ed8edfa (patch)
tree4abdd9622e5ef4128563ba04ac37511b1e03f92f /clientloop.c
parente6b950341dd75baa8526f1862bca39e52f5b879b (diff)
upstream commit
fix small memory leak when UpdateHostkeys=no
Diffstat (limited to 'clientloop.c')
-rw-r--r--clientloop.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/clientloop.c b/clientloop.c
index 8969869b6..a9c8a90f0 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: clientloop.c,v 1.271 2015/02/23 16:33:25 djm Exp $ */ 1/* $OpenBSD: clientloop.c,v 1.272 2015/02/25 19:54:02 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -2321,9 +2321,7 @@ client_input_hostkeys(void)
2321 char *fp; 2321 char *fp;
2322 static int hostkeys_seen = 0; /* XXX use struct ssh */ 2322 static int hostkeys_seen = 0; /* XXX use struct ssh */
2323 extern struct sockaddr_storage hostaddr; /* XXX from ssh.c */ 2323 extern struct sockaddr_storage hostaddr; /* XXX from ssh.c */
2324 struct hostkeys_update_ctx *ctx; 2324 struct hostkeys_update_ctx *ctx = NULL;
2325
2326 ctx = xcalloc(1, sizeof(*ctx));
2327 2325
2328 if (hostkeys_seen) 2326 if (hostkeys_seen)
2329 fatal("%s: server already sent hostkeys", __func__); 2327 fatal("%s: server already sent hostkeys", __func__);
@@ -2332,6 +2330,8 @@ client_input_hostkeys(void)
2332 return 1; /* won't ask in batchmode, so don't even try */ 2330 return 1; /* won't ask in batchmode, so don't even try */
2333 if (!options.update_hostkeys || options.num_user_hostfiles <= 0) 2331 if (!options.update_hostkeys || options.num_user_hostfiles <= 0)
2334 return 1; 2332 return 1;
2333
2334 ctx = xcalloc(1, sizeof(*ctx));
2335 while (ssh_packet_remaining(ssh) > 0) { 2335 while (ssh_packet_remaining(ssh) > 0) {
2336 sshkey_free(key); 2336 sshkey_free(key);
2337 key = NULL; 2337 key = NULL;