diff options
author | des <des@FreeBSD.org> | 2016-03-11 00:15:29 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2016-03-11 00:15:29 +0000 |
commit | bb6f58c772c321121b8148fe7726de90f90e1dec (patch) | |
tree | 755a41a3dcaa10393f1e0d17469bd517b8a0989a /crypto/openssh/authfile.c | |
parent | 0e0b4ac1f05aada737d7d2280ab40c6b06016981 (diff) | |
parent | 9169dee5c46ff1d9dfce5c97590347e20a54c84e (diff) | |
download | FreeBSD-src-bb6f58c772c321121b8148fe7726de90f90e1dec.zip FreeBSD-src-bb6f58c772c321121b8148fe7726de90f90e1dec.tar.gz |
Upgrade to OpenSSH 7.2p2.
Diffstat (limited to 'crypto/openssh/authfile.c')
-rw-r--r-- | crypto/openssh/authfile.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/crypto/openssh/authfile.c b/crypto/openssh/authfile.c index 58f589a..d670424 100644 --- a/crypto/openssh/authfile.c +++ b/crypto/openssh/authfile.c @@ -1,4 +1,4 @@ -/* $OpenBSD: authfile.c,v 1.116 2015/07/09 09:49:46 markus Exp $ */ +/* $OpenBSD: authfile.c,v 1.120 2015/12/11 04:21:11 mmcc Exp $ */ /* * Copyright (c) 2000, 2013 Markus Friedl. All rights reserved. * @@ -243,8 +243,7 @@ sshkey_load_private_type_fd(int fd, int type, const char *passphrase, /* success */ r = 0; out: - if (buffer != NULL) - sshbuf_free(buffer); + sshbuf_free(buffer); return r; } @@ -272,14 +271,13 @@ sshkey_load_private(const char *filename, const char *passphrase, goto out; } if ((r = sshkey_load_file(fd, buffer)) != 0 || - (r = sshkey_parse_private_fileblob(buffer, passphrase, filename, - keyp, commentp)) != 0) + (r = sshkey_parse_private_fileblob(buffer, passphrase, keyp, + commentp)) != 0) goto out; r = 0; out: close(fd); - if (buffer != NULL) - sshbuf_free(buffer); + sshbuf_free(buffer); return r; } @@ -426,10 +424,8 @@ sshkey_load_cert(const char *filename, struct sshkey **keyp) r = 0; out: - if (file != NULL) - free(file); - if (pub != NULL) - sshkey_free(pub); + free(file); + sshkey_free(pub); return r; } @@ -474,10 +470,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; } @@ -538,8 +532,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; } |