[openssh-commits] [openssh] 01/03: upstream commit

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Feb 9 20:00:49 AEDT 2018


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit f1f047fb031c0081dbc8738f05bf5d4cc47acadf
Author: dtucker at openbsd.org <dtucker at openbsd.org>
Date:   Wed Feb 7 22:52:45 2018 +0000

    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 +++-----
 ssh-keysign.c  | 4 ++--
 sshconnect.c   | 5 ++---
 sshconnect2.c  | 5 ++---
 4 files changed, 9 insertions(+), 13 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;
diff --git a/ssh-keysign.c b/ssh-keysign.c
index ac5034de..17e87a28 100644
--- a/ssh-keysign.c
+++ b/ssh-keysign.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keysign.c,v 1.52 2016/02/15 09:47:49 dtucker Exp $ */
+/* $OpenBSD: ssh-keysign.c,v 1.53 2018/02/07 22:52:45 dtucker Exp $ */
 /*
  * Copyright (c) 2002 Markus Friedl.  All rights reserved.
  *
@@ -158,7 +158,7 @@ valid_request(struct passwd *pw, char *host, struct sshkey **ret,
 
 	debug3("%s: fail %d", __func__, fail);
 
-	if (fail && key != NULL)
+	if (fail)
 		sshkey_free(key);
 	else if (ret != NULL)
 		*ret = key;
diff --git a/sshconnect.c b/sshconnect.c
index cddf22e1..e37bb085 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect.c,v 1.292 2018/01/23 18:33:49 stsp Exp $ */
+/* $OpenBSD: sshconnect.c,v 1.293 2018/02/07 22:52:45 dtucker Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -1177,8 +1177,7 @@ fail:
 		host_key = raw_key;
 		goto retry;
 	}
-	if (raw_key != NULL)
-		sshkey_free(raw_key);
+	sshkey_free(raw_key);
 	free(ip);
 	free(host);
 	if (host_hostkeys != NULL)
diff --git a/sshconnect2.c b/sshconnect2.c
index 870c3d27..8138e46e 100644
--- a/sshconnect2.c
+++ b/sshconnect2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect2.c,v 1.267 2018/01/23 05:27:21 djm Exp $ */
+/* $OpenBSD: sshconnect2.c,v 1.268 2018/02/07 22:52:45 dtucker Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  * Copyright (c) 2008 Damien Miller.  All rights reserved.
@@ -624,8 +624,7 @@ input_userauth_pk_ok(int type, u_int32_t seq, struct ssh *ssh)
 		}
 	}
 done:
-	if (key != NULL)
-		key_free(key);
+	key_free(key);
 	free(pkalg);
 	free(pkblob);
 

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list