summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2015-03-11 00:48:40 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2015-03-11 00:48:40 +0000
commit219913b1e3710fd53755b6bb2f376322aa588ef8 (patch)
treedcee09476a3bb32a1eee6a870c1ccf0df5f70c8c /usr.bin
parente77d7d54265b0ab313e30b25bf092bf380d810a2 (diff)
add back the changes from rev 1.206, djm reverted this by mistake in
rev 1.207
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/packet.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/ssh/packet.c b/usr.bin/ssh/packet.c
index f59964af5e5..297175487e6 100644
--- a/usr.bin/ssh/packet.c
+++ b/usr.bin/ssh/packet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.208 2015/02/13 18:57:00 markus Exp $ */
+/* $OpenBSD: packet.c,v 1.209 2015/03/11 00:48:39 jsg Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -284,6 +284,7 @@ ssh_packet_set_connection(struct ssh *ssh, int fd_in, int fd_out)
(r = cipher_init(&state->receive_context, none,
(const u_char *)"", 0, NULL, 0, CIPHER_DECRYPT)) != 0) {
error("%s: cipher_init failed: %s", __func__, ssh_err(r));
+ free(ssh);
return NULL;
}
state->newkeys[MODE_IN] = state->newkeys[MODE_OUT] = NULL;
@@ -1267,8 +1268,10 @@ ssh_packet_read_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p)
* Since we are blocking, ensure that all written packets have
* been sent.
*/
- if ((r = ssh_packet_write_wait(ssh)) != 0)
+ if ((r = ssh_packet_write_wait(ssh)) != 0) {
+ free(setp);
return r;
+ }
/* Stay in the loop until we have received a complete packet. */
for (;;) {