From 52d7078421844b2f88329f5be3de370b0a938636 Mon Sep 17 00:00:00 2001 From: "mmcc@openbsd.org" Date: Fri, 11 Dec 2015 04:21:11 +0000 Subject: upstream commit Remove NULL-checks before sshbuf_free(). ok djm@ Upstream-ID: 5ebed00ed5f9f03b119a345085e8774565466917 --- ssh-ecdsa.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'ssh-ecdsa.c') diff --git a/ssh-ecdsa.c b/ssh-ecdsa.c index 2c76f8b43..74912dfd9 100644 --- a/ssh-ecdsa.c +++ b/ssh-ecdsa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-ecdsa.c,v 1.11 2014/06/24 01:13:21 djm Exp $ */ +/* $OpenBSD: ssh-ecdsa.c,v 1.12 2015/12/11 04:21:12 mmcc Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2010 Damien Miller. All rights reserved. @@ -99,10 +99,8 @@ ssh_ecdsa_sign(const struct sshkey *key, u_char **sigp, size_t *lenp, ret = 0; out: explicit_bzero(digest, sizeof(digest)); - if (b != NULL) - sshbuf_free(b); - if (bb != NULL) - sshbuf_free(bb); + sshbuf_free(b); + sshbuf_free(bb); if (sig != NULL) ECDSA_SIG_free(sig); return ret; @@ -179,10 +177,8 @@ ssh_ecdsa_verify(const struct sshkey *key, out: explicit_bzero(digest, sizeof(digest)); - if (sigbuf != NULL) - sshbuf_free(sigbuf); - if (b != NULL) - sshbuf_free(b); + sshbuf_free(sigbuf); + sshbuf_free(b); if (sig != NULL) ECDSA_SIG_free(sig); free(ktype); -- cgit v1.2.3