diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2022-08-01 11:09:27 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2022-08-01 11:09:27 +0000 |
commit | 9e779ee5b82c652e1278d5cb4c1aff8df571854f (patch) | |
tree | 3a3f67cd82eb211e9ae5432d56623697c0846c9c /usr.bin/ssh | |
parent | 26ec298b0b65ab08623cc96dd03042547a32e3fe (diff) |
avoid double-free in error path introduced in r1.70;
report and fix based on GHPR#332 by v-rzh
ok dtucker@
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r-- | usr.bin/ssh/ssh-keysign.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.bin/ssh/ssh-keysign.c b/usr.bin/ssh/ssh-keysign.c index ade85522ddd..dc358785ede 100644 --- a/usr.bin/ssh/ssh-keysign.c +++ b/usr.bin/ssh/ssh-keysign.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-keysign.c,v 1.70 2022/01/06 22:00:18 djm Exp $ */ +/* $OpenBSD: ssh-keysign.c,v 1.71 2022/08/01 11:09:26 djm Exp $ */ /* * Copyright (c) 2002 Markus Friedl. All rights reserved. * @@ -150,9 +150,7 @@ valid_request(struct passwd *pw, char *host, struct sshkey **ret, char **pkalgp, debug3_f("fail %d", fail); - if (fail) - sshkey_free(key); - else { + if (!fail) { if (ret != NULL) { *ret = key; key = NULL; |