diff options
author | djm@openbsd.org <djm@openbsd.org> | 2015-08-19 23:19:01 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2015-08-20 13:07:41 +1000 |
commit | ec6eda16ebab771aa3dfc90629b41953b999cb1e (patch) | |
tree | 6ccf25076f88d9754773fc5604e1b88a5a604bd6 | |
parent | 45b0eb752c94954a6de046bfaaf129e518ad4b5b (diff) |
upstream commit
fix double-free() in error path of DSA key generation
reported by Mateusz Kocielski; ok markus@
Upstream-ID: 4735d8f888b10599a935fa1b374787089116713c
-rw-r--r-- | sshkey.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshkey.c,v 1.20 2015/07/03 03:43:18 djm Exp $ */ | 1 | /* $OpenBSD: sshkey.c,v 1.21 2015/08/19 23:19:01 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. |
4 | * Copyright (c) 2008 Alexander von Gernler. All rights reserved. | 4 | * Copyright (c) 2008 Alexander von Gernler. All rights reserved. |
@@ -1556,7 +1556,6 @@ dsa_generate_private_key(u_int bits, DSA **dsap) | |||
1556 | *dsap = NULL; | 1556 | *dsap = NULL; |
1557 | if (!DSA_generate_parameters_ex(private, bits, NULL, 0, NULL, | 1557 | if (!DSA_generate_parameters_ex(private, bits, NULL, 0, NULL, |
1558 | NULL, NULL) || !DSA_generate_key(private)) { | 1558 | NULL, NULL) || !DSA_generate_key(private)) { |
1559 | DSA_free(private); | ||
1560 | ret = SSH_ERR_LIBCRYPTO_ERROR; | 1559 | ret = SSH_ERR_LIBCRYPTO_ERROR; |
1561 | goto out; | 1560 | goto out; |
1562 | } | 1561 | } |