summaryrefslogtreecommitdiff
path: root/packet.c
diff options
context:
space:
mode:
authormmcc@openbsd.org <mmcc@openbsd.org>2015-12-11 04:21:11 +0000
committerDamien Miller <djm@mindrot.org>2015-12-18 14:50:48 +1100
commit52d7078421844b2f88329f5be3de370b0a938636 (patch)
tree1241462a841b14259755de181563cc83acd42109 /packet.c
parenta4b9e0f4e4a6980a0eb8072f76ea611cab5b77e7 (diff)
upstream commit
Remove NULL-checks before sshbuf_free(). ok djm@ Upstream-ID: 5ebed00ed5f9f03b119a345085e8774565466917
Diffstat (limited to 'packet.c')
-rw-r--r--packet.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/packet.c b/packet.c
index 8d9bcd8db..27e85e3a1 100644
--- a/packet.c
+++ b/packet.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: packet.c,v 1.220 2015/12/11 03:24:25 djm Exp $ */ 1/* $OpenBSD: packet.c,v 1.221 2015/12/11 04:21:12 mmcc 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
@@ -2453,8 +2453,7 @@ newkeys_to_blob(struct sshbuf *m, struct ssh *ssh, int mode)
2453 goto out; 2453 goto out;
2454 r = sshbuf_put_stringb(m, b); 2454 r = sshbuf_put_stringb(m, b);
2455 out: 2455 out:
2456 if (b != NULL) 2456 sshbuf_free(b);
2457 sshbuf_free(b);
2458 return r; 2457 return r;
2459} 2458}
2460 2459
@@ -2590,8 +2589,7 @@ newkeys_from_blob(struct sshbuf *m, struct ssh *ssh, int mode)
2590 r = 0; 2589 r = 0;
2591 out: 2590 out:
2592 free(newkey); 2591 free(newkey);
2593 if (b != NULL) 2592 sshbuf_free(b);
2594 sshbuf_free(b);
2595 return r; 2593 return r;
2596} 2594}
2597 2595
@@ -2624,10 +2622,8 @@ kex_from_blob(struct sshbuf *m, struct kex **kexp)
2624 out: 2622 out:
2625 if (r != 0 || kexp == NULL) { 2623 if (r != 0 || kexp == NULL) {
2626 if (kex != NULL) { 2624 if (kex != NULL) {
2627 if (kex->my != NULL) 2625 sshbuf_free(kex->my);
2628 sshbuf_free(kex->my); 2626 sshbuf_free(kex->peer);
2629 if (kex->peer != NULL)
2630 sshbuf_free(kex->peer);
2631 free(kex); 2627 free(kex);
2632 } 2628 }
2633 if (kexp != NULL) 2629 if (kexp != NULL)