summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2016-02-15 23:32:38 +0000
committerDamien Miller <djm@cvs.openbsd.org>2016-02-15 23:32:38 +0000
commit13fdb09fc1778cac15c998fb6a848600380767c4 (patch)
tree824f681d77a2fe5333f4576a4e1576cd98e575c2
parent046ff44a8601a5debe7f58a677cbdbc9f0f81880 (diff)
memleak of algorithm name in mm_answer_sign; reported by Jakub Jelen
-rw-r--r--usr.bin/ssh/monitor.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/ssh/monitor.c b/usr.bin/ssh/monitor.c
index 7e59689fe56..d5b375fb03b 100644
--- a/usr.bin/ssh/monitor.c
+++ b/usr.bin/ssh/monitor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: monitor.c,v 1.156 2016/01/14 16:17:39 markus Exp $ */
+/* $OpenBSD: monitor.c,v 1.157 2016/02/15 23:32:37 djm Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* Copyright 2002 Markus Friedl <markus@openbsd.org>
@@ -588,10 +588,9 @@ mm_answer_sign(int sock, Buffer *m)
struct ssh *ssh = active_state; /* XXX */
extern int auth_sock; /* XXX move to state struct? */
struct sshkey *key;
- struct sshbuf *sigbuf;
- u_char *p;
- u_char *signature;
- char *alg;
+ struct sshbuf *sigbuf = NULL;
+ u_char *p = NULL, *signature = NULL;
+ char *alg = NULL;
size_t datlen, siglen, alglen;
int r, keyid, is_proof = 0;
const char proof_req[] = "hostkeys-prove-00@openssh.com";
@@ -668,6 +667,7 @@ mm_answer_sign(int sock, Buffer *m)
if ((r = sshbuf_put_string(m, signature, siglen)) != 0)
fatal("%s: buffer error: %s", __func__, ssh_err(r));
+ free(alg);
free(p);
free(signature);