diff options
author | mmcc@openbsd.org <mmcc@openbsd.org> | 2015-12-11 02:31:47 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2015-12-18 14:49:32 +1100 |
commit | 89540b6de025b80404a0cb8418c06377f3f98848 (patch) | |
tree | e5ba6b2acbaab9aa3b89c3ff0c0b14adddfa19db /authfile.c | |
parent | 79394ed6d74572c2d2643d73937dad33727fc240 (diff) |
upstream commit
Remove NULL-checks before sshkey_free().
ok djm@
Upstream-ID: 3e35afe8a25e021216696b5d6cde7f5d2e5e3f52
Diffstat (limited to 'authfile.c')
-rw-r--r-- | authfile.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/authfile.c b/authfile.c index 668df7d9e..9cd490ca3 100644 --- a/authfile.c +++ b/authfile.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: authfile.c,v 1.118 2015/12/10 17:08:40 mmcc Exp $ */ | 1 | /* $OpenBSD: authfile.c,v 1.119 2015/12/11 02:31:47 mmcc Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000, 2013 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2000, 2013 Markus Friedl. All rights reserved. |
4 | * | 4 | * |
@@ -427,8 +427,7 @@ sshkey_load_cert(const char *filename, struct sshkey **keyp) | |||
427 | 427 | ||
428 | out: | 428 | out: |
429 | free(file); | 429 | free(file); |
430 | if (pub != NULL) | 430 | sshkey_free(pub); |
431 | sshkey_free(pub); | ||
432 | return r; | 431 | return r; |
433 | } | 432 | } |
434 | 433 | ||
@@ -473,10 +472,8 @@ sshkey_load_private_cert(int type, const char *filename, const char *passphrase, | |||
473 | *keyp = key; | 472 | *keyp = key; |
474 | key = NULL; | 473 | key = NULL; |
475 | out: | 474 | out: |
476 | if (key != NULL) | 475 | sshkey_free(key); |
477 | sshkey_free(key); | 476 | sshkey_free(cert); |
478 | if (cert != NULL) | ||
479 | sshkey_free(cert); | ||
480 | return r; | 477 | return r; |
481 | } | 478 | } |
482 | 479 | ||
@@ -537,8 +534,7 @@ sshkey_in_file(struct sshkey *key, const char *filename, int strict_type, | |||
537 | } | 534 | } |
538 | r = SSH_ERR_KEY_NOT_FOUND; | 535 | r = SSH_ERR_KEY_NOT_FOUND; |
539 | out: | 536 | out: |
540 | if (pub != NULL) | 537 | sshkey_free(pub); |
541 | sshkey_free(pub); | ||
542 | fclose(f); | 538 | fclose(f); |
543 | return r; | 539 | return r; |
544 | } | 540 | } |