diff options
author | djm@openbsd.org <djm@openbsd.org> | 2016-02-15 23:32:37 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2016-02-16 10:44:01 +1100 |
commit | 24c9bded569d9f2449ded73f92fb6d12db7a9eec (patch) | |
tree | b69b1d472b2ac95f3ee135f3575303025a5ea8c9 | |
parent | ffb1e7e896139a42ceb78676f637658f44612411 (diff) |
upstream commit
memleak of algorithm name in mm_answer_sign; reported by
Jakub Jelen
Upstream-ID: ccd742cd25952240ebd23d7d4d6b605862584d08
-rw-r--r-- | monitor.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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 | ||