From f1f047fb031c0081dbc8738f05bf5d4cc47acadf Mon Sep 17 00:00:00 2001 From: "dtucker@openbsd.org" Date: Wed, 7 Feb 2018 22:52:45 +0000 Subject: upstream commit ssh_free checks for and handles NULL args, remove NULL checks from remaining callers. ok djm@ OpenBSD-Commit-ID: bb926825c53724c069df68a93a2597f9192f7e7b --- auth2-pubkey.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'auth2-pubkey.c') 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; -- cgit v1.2.1