diff options
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; } |