diff options
author | 2015-12-11 02:31:47 +0000 | |
---|---|---|
committer | 2015-12-11 02:31:47 +0000 | |
commit | 5fb8de7dd2c66851536ccb7dd27da54220e963f9 (patch) | |
tree | 56443100bade97d819c409a4e9fc644411d6a243 /usr.bin/ssh/sshkey.c | |
parent | fflush stdout so that output is seen even when running in debug mode when (diff) | |
download | wireguard-openbsd-5fb8de7dd2c66851536ccb7dd27da54220e963f9.tar.xz wireguard-openbsd-5fb8de7dd2c66851536ccb7dd27da54220e963f9.zip |
Remove NULL-checks before sshkey_free().
ok djm@
Diffstat (limited to 'usr.bin/ssh/sshkey.c')
-rw-r--r-- | usr.bin/ssh/sshkey.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/usr.bin/ssh/sshkey.c b/usr.bin/ssh/sshkey.c index edf0fa43162..e5500268893 100644 --- a/usr.bin/ssh/sshkey.c +++ b/usr.bin/ssh/sshkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshkey.c,v 1.29 2015/12/10 17:08:40 mmcc Exp $ */ +/* $OpenBSD: sshkey.c,v 1.30 2015/12/11 02:31:47 mmcc Exp $ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. * Copyright (c) 2008 Alexander von Gernler. All rights reserved. @@ -410,8 +410,7 @@ cert_free(struct sshkey_cert *cert) for (i = 0; i < cert->nprincipals; i++) free(cert->principals[i]); free(cert->principals); - if (cert->signature_key != NULL) - sshkey_free(cert->signature_key); + sshkey_free(cert->signature_key); explicit_bzero(cert, sizeof(*cert)); free(cert); } @@ -3591,8 +3590,7 @@ sshkey_parse_public_rsa1_fileblob(struct sshbuf *blob, out: if (copy != NULL) sshbuf_free(copy); - if (pub != NULL) - sshkey_free(pub); + sshkey_free(pub); return r; } @@ -3705,8 +3703,7 @@ sshkey_parse_private_rsa1(struct sshbuf *blob, const char *passphrase, out: explicit_bzero(&ciphercontext, sizeof(ciphercontext)); free(comment); - if (prv != NULL) - sshkey_free(prv); + sshkey_free(prv); if (copy != NULL) sshbuf_free(copy); if (decrypted != NULL) @@ -3798,8 +3795,7 @@ sshkey_parse_private_pem_fileblob(struct sshbuf *blob, int type, BIO_free(bio); if (pk != NULL) EVP_PKEY_free(pk); - if (prv != NULL) - sshkey_free(prv); + sshkey_free(prv); return r; } #endif /* WITH_OPENSSL */ |