summaryrefslogtreecommitdiffstats
path: root/authfile.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 /authfile.c
parent79394ed6d74572c2d2643d73937dad33727fc240 (diff)
upstream commit
Remove NULL-checks before sshkey_free(). ok djm@ Upstream-ID: 3e35afe8a25e021216696b5d6cde7f5d2e5e3f52
Diffstat (limited to 'authfile.c')
-rw-r--r--authfile.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/authfile.c b/authfile.c
index 668df7d9..9cd490ca 100644
--- a/authfile.c
+++ b/authfile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: authfile.c,v 1.118 2015/12/10 17:08:40 mmcc Exp $ */
+/* $OpenBSD: authfile.c,v 1.119 2015/12/11 02:31:47 mmcc Exp $ */
/*
* Copyright (c) 2000, 2013 Markus Friedl. All rights reserved.
*
@@ -427,8 +427,7 @@ sshkey_load_cert(const char *filename, struct sshkey **keyp)
out:
free(file);
- if (pub != NULL)
- sshkey_free(pub);
+ sshkey_free(pub);
return r;
}
@@ -473,10 +472,8 @@ sshkey_load_private_cert(int type, const char *filename, const char *passphrase,
*keyp = key;
key = NULL;
out:
- if (key != NULL)
- sshkey_free(key);
- if (cert != NULL)
- sshkey_free(cert);
+ sshkey_free(key);
+ sshkey_free(cert);
return r;
}
@@ -537,8 +534,7 @@ sshkey_in_file(struct sshkey *key, const char *filename, int strict_type,
}
r = SSH_ERR_KEY_NOT_FOUND;
out:
- if (pub != NULL)
- sshkey_free(pub);
+ sshkey_free(pub);
fclose(f);
return r;
}