]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: avoid double-free in error path introduced in r1.70; report
authordjm@openbsd.org <djm@openbsd.org>
Mon, 1 Aug 2022 11:09:26 +0000 (11:09 +0000)
committerDamien Miller <djm@mindrot.org>
Mon, 1 Aug 2022 11:11:33 +0000 (21:11 +1000)
and fix based on GHPR#332 by v-rzh ok dtucker@

OpenBSD-Commit-ID: 3d21aa127b1f37cfc5bdc21461db369a663a951f

ssh-keysign.c

index c52321e220e7dba3f031389c3328a81f48220a30..b989f5e941ad6e2d37e596985092029dfe430540 100644 (file)
@@ -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.
  *
@@ -155,9 +155,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;