summaryrefslogtreecommitdiff
path: root/krl.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 /krl.c
parenta4b9e0f4e4a6980a0eb8072f76ea611cab5b77e7 (diff)
upstream commit
Remove NULL-checks before sshbuf_free(). ok djm@ Upstream-ID: 5ebed00ed5f9f03b119a345085e8774565466917
Diffstat (limited to 'krl.c')
-rw-r--r--krl.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/krl.c b/krl.c
index 0194f1c72..ec3b82bea 100644
--- a/krl.c
+++ b/krl.c
@@ -14,7 +14,7 @@
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */ 15 */
16 16
17/* $OpenBSD: krl.c,v 1.35 2015/12/04 16:41:28 markus Exp $ */ 17/* $OpenBSD: krl.c,v 1.36 2015/12/11 04:21:12 mmcc Exp $ */
18 18
19#include "includes.h" 19#include "includes.h"
20 20
@@ -826,10 +826,8 @@ parse_revoked_certs(struct sshbuf *buf, struct ssh_krl *krl)
826 goto out; 826 goto out;
827 827
828 while (sshbuf_len(buf) > 0) { 828 while (sshbuf_len(buf) > 0) {
829 if (subsect != NULL) { 829 sshbuf_free(subsect);
830 sshbuf_free(subsect); 830 subsect = NULL;
831 subsect = NULL;
832 }
833 if ((r = sshbuf_get_u8(buf, &type)) != 0 || 831 if ((r = sshbuf_get_u8(buf, &type)) != 0 ||
834 (r = sshbuf_froms(buf, &subsect)) != 0) 832 (r = sshbuf_froms(buf, &subsect)) != 0)
835 goto out; 833 goto out;
@@ -1059,10 +1057,8 @@ ssh_krl_from_blob(struct sshbuf *buf, struct ssh_krl **krlp,
1059 if ((r = sshbuf_consume(copy, sects_off)) != 0) 1057 if ((r = sshbuf_consume(copy, sects_off)) != 0)
1060 goto out; 1058 goto out;
1061 while (sshbuf_len(copy) > 0) { 1059 while (sshbuf_len(copy) > 0) {
1062 if (sect != NULL) { 1060 sshbuf_free(sect);
1063 sshbuf_free(sect); 1061 sect = NULL;
1064 sect = NULL;
1065 }
1066 if ((r = sshbuf_get_u8(copy, &type)) != 0 || 1062 if ((r = sshbuf_get_u8(copy, &type)) != 0 ||
1067 (r = sshbuf_froms(copy, &sect)) != 0) 1063 (r = sshbuf_froms(copy, &sect)) != 0)
1068 goto out; 1064 goto out;