summaryrefslogtreecommitdiff
path: root/auth2-pubkey.c
diff options
context:
space:
mode:
authordtucker@openbsd.org <dtucker@openbsd.org>2018-02-07 22:52:45 +0000
committerDamien Miller <djm@mindrot.org>2018-02-09 20:00:18 +1100
commitf1f047fb031c0081dbc8738f05bf5d4cc47acadf (patch)
tree1be06338e02d74a923527cdc03b88b472294a420 /auth2-pubkey.c
parentaee49b2a89b6b323c80dd3b431bd486e51f94c8c (diff)
downloadopenssh-git-f1f047fb031c0081dbc8738f05bf5d4cc47acadf.tar.gz
upstream commit
ssh_free checks for and handles NULL args, remove NULL checks from remaining callers. ok djm@ OpenBSD-Commit-ID: bb926825c53724c069df68a93a2597f9192f7e7b
Diffstat (limited to 'auth2-pubkey.c')
-rw-r--r--auth2-pubkey.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/auth2-pubkey.c b/auth2-pubkey.c
index e6498228..8fb7ffe7 100644
--- a/auth2-pubkey.c
+++ b/auth2-pubkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth2-pubkey.c,v 1.75 2018/01/23 05:27:21 djm Exp $ */
+/* $OpenBSD: auth2-pubkey.c,v 1.76 2018/02/07 22:52:45 dtucker Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
@@ -471,8 +471,7 @@ check_authkeys_file(FILE *f, char *file, struct sshkey *key, struct passwd *pw)
/* Always consume entire file */
if (found_key)
continue;
- if (found != NULL)
- sshkey_free(found);
+ sshkey_free(found);
found = sshkey_new(sshkey_is_cert(key) ? KEY_UNSPEC : key->type);
if (found == NULL)
goto done;
@@ -563,8 +562,7 @@ check_authkeys_file(FILE *f, char *file, struct sshkey *key, struct passwd *pw)
}
}
done:
- if (found != NULL)
- sshkey_free(found);
+ sshkey_free(found);
if (!found_key)
debug2("key not found");
return found_key;