diff options
Diffstat (limited to 'sshbuf-misc.c')
-rw-r--r-- | sshbuf-misc.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sshbuf-misc.c b/sshbuf-misc.c index c0336e867..9b5aa208c 100644 --- a/sshbuf-misc.c +++ b/sshbuf-misc.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshbuf-misc.c,v 1.13 2020/01/25 23:28:06 djm Exp $ */ | 1 | /* $OpenBSD: sshbuf-misc.c,v 1.14 2020/02/26 13:40:09 jsg Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2011 Damien Miller | 3 | * Copyright (c) 2011 Damien Miller |
4 | * | 4 | * |
@@ -156,17 +156,14 @@ sshbuf_b64tod(struct sshbuf *buf, const char *b64) | |||
156 | if ((p = malloc(plen)) == NULL) | 156 | if ((p = malloc(plen)) == NULL) |
157 | return SSH_ERR_ALLOC_FAIL; | 157 | return SSH_ERR_ALLOC_FAIL; |
158 | if ((nlen = b64_pton(b64, p, plen)) < 0) { | 158 | if ((nlen = b64_pton(b64, p, plen)) < 0) { |
159 | explicit_bzero(p, plen); | 159 | freezero(p, plen); |
160 | free(p); | ||
161 | return SSH_ERR_INVALID_FORMAT; | 160 | return SSH_ERR_INVALID_FORMAT; |
162 | } | 161 | } |
163 | if ((r = sshbuf_put(buf, p, nlen)) < 0) { | 162 | if ((r = sshbuf_put(buf, p, nlen)) < 0) { |
164 | explicit_bzero(p, plen); | 163 | freezero(p, plen); |
165 | free(p); | ||
166 | return r; | 164 | return r; |
167 | } | 165 | } |
168 | explicit_bzero(p, plen); | 166 | freezero(p, plen); |
169 | free(p); | ||
170 | return 0; | 167 | return 0; |
171 | } | 168 | } |
172 | 169 | ||