summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsg@openbsd.org <jsg@openbsd.org>2015-02-09 23:22:37 +0000
committerDamien Miller <djm@mindrot.org>2015-02-11 12:26:30 +1100
commit4af1709cf774475ce5d1bc3ddcc165f6c222897d (patch)
tree20ba294f703e24424147d4b0cf492ed8b9faf824
parentfd36834871d06a03e1ff8d69e41992efa1bbf85f (diff)
upstream commit
fix some leaks in error paths ok markus@
-rw-r--r--packet.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/packet.c b/packet.c
index f9ce08412..8b8ab0c0c 100644
--- a/packet.c
+++ b/packet.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: packet.c,v 1.205 2015/01/30 01:13:33 djm Exp $ */ 1/* $OpenBSD: packet.c,v 1.206 2015/02/09 23:22:37 jsg 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
@@ -290,6 +290,7 @@ ssh_packet_set_connection(struct ssh *ssh, int fd_in, int fd_out)
290 (r = cipher_init(&state->receive_context, none, 290 (r = cipher_init(&state->receive_context, none,
291 (const u_char *)"", 0, NULL, 0, CIPHER_DECRYPT)) != 0) { 291 (const u_char *)"", 0, NULL, 0, CIPHER_DECRYPT)) != 0) {
292 error("%s: cipher_init failed: %s", __func__, ssh_err(r)); 292 error("%s: cipher_init failed: %s", __func__, ssh_err(r));
293 free(ssh);
293 return NULL; 294 return NULL;
294 } 295 }
295 state->newkeys[MODE_IN] = state->newkeys[MODE_OUT] = NULL; 296 state->newkeys[MODE_IN] = state->newkeys[MODE_OUT] = NULL;
@@ -1273,8 +1274,10 @@ ssh_packet_read_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p)
1273 * Since we are blocking, ensure that all written packets have 1274 * Since we are blocking, ensure that all written packets have
1274 * been sent. 1275 * been sent.
1275 */ 1276 */
1276 if ((r = ssh_packet_write_wait(ssh)) != 0) 1277 if ((r = ssh_packet_write_wait(ssh)) != 0) {
1278 free(setp);
1277 return r; 1279 return r;
1280 }
1278 1281
1279 /* Stay in the loop until we have received a complete packet. */ 1282 /* Stay in the loop until we have received a complete packet. */
1280 for (;;) { 1283 for (;;) {