summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--auth2-pubkey.c8
-rw-r--r--ssh-keysign.c4
-rw-r--r--sshconnect.c5
-rw-r--r--sshconnect2.c5
4 files changed, 9 insertions, 13 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;
diff --git a/ssh-keysign.c b/ssh-keysign.c
index ac5034de8..17e87a281 100644
--- a/ssh-keysign.c
+++ b/ssh-keysign.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-keysign.c,v 1.52 2016/02/15 09:47:49 dtucker Exp $ */ 1/* $OpenBSD: ssh-keysign.c,v 1.53 2018/02/07 22:52:45 dtucker Exp $ */
2/* 2/*
3 * Copyright (c) 2002 Markus Friedl. All rights reserved. 3 * Copyright (c) 2002 Markus Friedl. All rights reserved.
4 * 4 *
@@ -158,7 +158,7 @@ valid_request(struct passwd *pw, char *host, struct sshkey **ret,
158 158
159 debug3("%s: fail %d", __func__, fail); 159 debug3("%s: fail %d", __func__, fail);
160 160
161 if (fail && key != NULL) 161 if (fail)
162 sshkey_free(key); 162 sshkey_free(key);
163 else if (ret != NULL) 163 else if (ret != NULL)
164 *ret = key; 164 *ret = key;
diff --git a/sshconnect.c b/sshconnect.c
index cddf22e1c..e37bb0856 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshconnect.c,v 1.292 2018/01/23 18:33:49 stsp Exp $ */ 1/* $OpenBSD: sshconnect.c,v 1.293 2018/02/07 22:52:45 dtucker Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1177,8 +1177,7 @@ fail:
1177 host_key = raw_key; 1177 host_key = raw_key;
1178 goto retry; 1178 goto retry;
1179 } 1179 }
1180 if (raw_key != NULL) 1180 sshkey_free(raw_key);
1181 sshkey_free(raw_key);
1182 free(ip); 1181 free(ip);
1183 free(host); 1182 free(host);
1184 if (host_hostkeys != NULL) 1183 if (host_hostkeys != NULL)
diff --git a/sshconnect2.c b/sshconnect2.c
index 870c3d270..8138e46e0 100644
--- a/sshconnect2.c
+++ b/sshconnect2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshconnect2.c,v 1.267 2018/01/23 05:27:21 djm Exp $ */ 1/* $OpenBSD: sshconnect2.c,v 1.268 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 * Copyright (c) 2008 Damien Miller. All rights reserved. 4 * 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)
624 } 624 }
625 } 625 }
626done: 626done:
627 if (key != NULL) 627 key_free(key);
628 key_free(key);
629 free(pkalg); 628 free(pkalg);
630 free(pkblob); 629 free(pkblob);
631 630