summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2016-02-15 23:32:37 +0000
committerDamien Miller <djm@mindrot.org>2016-02-16 10:44:01 +1100
commit24c9bded569d9f2449ded73f92fb6d12db7a9eec (patch)
treeb69b1d472b2ac95f3ee135f3575303025a5ea8c9
parentffb1e7e896139a42ceb78676f637658f44612411 (diff)
upstream commit
memleak of algorithm name in mm_answer_sign; reported by Jakub Jelen Upstream-ID: ccd742cd25952240ebd23d7d4d6b605862584d08
-rw-r--r--monitor.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/monitor.c b/monitor.c
index b7fe74b13..ac7dd3099 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: monitor.c,v 1.156 2016/01/14 16:17:39 markus Exp $ */ 1/* $OpenBSD: monitor.c,v 1.157 2016/02/15 23:32:37 djm Exp $ */
2/* 2/*
3 * Copyright 2002 Niels Provos <provos@citi.umich.edu> 3 * Copyright 2002 Niels Provos <provos@citi.umich.edu>
4 * Copyright 2002 Markus Friedl <markus@openbsd.org> 4 * Copyright 2002 Markus Friedl <markus@openbsd.org>
@@ -684,10 +684,9 @@ mm_answer_sign(int sock, Buffer *m)
684 struct ssh *ssh = active_state; /* XXX */ 684 struct ssh *ssh = active_state; /* XXX */
685 extern int auth_sock; /* XXX move to state struct? */ 685 extern int auth_sock; /* XXX move to state struct? */
686 struct sshkey *key; 686 struct sshkey *key;
687 struct sshbuf *sigbuf; 687 struct sshbuf *sigbuf = NULL;
688 u_char *p; 688 u_char *p = NULL, *signature = NULL;
689 u_char *signature; 689 char *alg = NULL;
690 char *alg;
691 size_t datlen, siglen, alglen; 690 size_t datlen, siglen, alglen;
692 int r, keyid, is_proof = 0; 691 int r, keyid, is_proof = 0;
693 const char proof_req[] = "hostkeys-prove-00@openssh.com"; 692 const char proof_req[] = "hostkeys-prove-00@openssh.com";
@@ -764,6 +763,7 @@ mm_answer_sign(int sock, Buffer *m)
764 if ((r = sshbuf_put_string(m, signature, siglen)) != 0) 763 if ((r = sshbuf_put_string(m, signature, siglen)) != 0)
765 fatal("%s: buffer error: %s", __func__, ssh_err(r)); 764 fatal("%s: buffer error: %s", __func__, ssh_err(r));
766 765
766 free(alg);
767 free(p); 767 free(p);
768 free(signature); 768 free(signature);
769 769