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)
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 e64982283..8fb7ffe71 100644
--- a/auth2-pubkey.c
+++ b/auth2-pubkey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth2-pubkey.c,v 1.75 2018/01/23 05:27:21 djm Exp $ */ 1/* $OpenBSD: auth2-pubkey.c,v 1.76 2018/02/07 22:52:45 dtucker Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -471,8 +471,7 @@ check_authkeys_file(FILE *f, char *file, struct sshkey *key, struct passwd *pw)
471 /* Always consume entire file */ 471 /* Always consume entire file */
472 if (found_key) 472 if (found_key)
473 continue; 473 continue;
474 if (found != NULL) 474 sshkey_free(found);
475 sshkey_free(found);
476 found = sshkey_new(sshkey_is_cert(key) ? KEY_UNSPEC : key->type); 475 found = sshkey_new(sshkey_is_cert(key) ? KEY_UNSPEC : key->type);
477 if (found == NULL) 476 if (found == NULL)
478 goto done; 477 goto done;
@@ -563,8 +562,7 @@ check_authkeys_file(FILE *f, char *file, struct sshkey *key, struct passwd *pw)
563 } 562 }
564 } 563 }
565 done: 564 done:
566 if (found != NULL) 565 sshkey_free(found);
567 sshkey_free(found);
568 if (!found_key) 566 if (!found_key)
569 debug2("key not found"); 567 debug2("key not found");
570 return found_key; 568 return found_key;