summaryrefslogtreecommitdiff
path: root/sshkey.c
diff options
context:
space:
mode:
authormmcc@openbsd.org <mmcc@openbsd.org>2015-12-11 02:31:47 +0000
committerDamien Miller <djm@mindrot.org>2015-12-18 14:49:32 +1100
commit89540b6de025b80404a0cb8418c06377f3f98848 (patch)
treee5ba6b2acbaab9aa3b89c3ff0c0b14adddfa19db /sshkey.c
parent79394ed6d74572c2d2643d73937dad33727fc240 (diff)
upstream commit
Remove NULL-checks before sshkey_free(). ok djm@ Upstream-ID: 3e35afe8a25e021216696b5d6cde7f5d2e5e3f52
Diffstat (limited to 'sshkey.c')
-rw-r--r--sshkey.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sshkey.c b/sshkey.c
index 87abea1e..96a4d909 100644
--- a/sshkey.c
+++ b/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.
@@ -430,8 +430,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);
}
@@ -3647,8 +3646,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;
}
@@ -3761,8 +3759,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)
@@ -3856,8 +3853,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 */