[openssh-commits] [openssh] 04/13: upstream commit
git+noreply at mindrot.org
git+noreply at mindrot.org
Mon Oct 13 11:42:10 EST 2014
This is an automated email from the git hooks/post-receive script.
djm pushed a commit to branch master
in repository openssh.
commit 7df8818409c752cf3f0c3f8044fe9aebed8647bd
Author: doug at openbsd.org <doug at openbsd.org>
Date: Thu Aug 21 01:08:52 2014 +0000
upstream commit
Free resources on error in mkstemp and fdopen
ok djm@
---
moduli.c | 3 ++-
ssh-keygen.c | 4 +++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/moduli.c b/moduli.c
index bb4dd7b..474caca 100644
--- a/moduli.c
+++ b/moduli.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: moduli.c,v 1.28 2013/10/24 00:49:49 dtucker Exp $ */
+/* $OpenBSD: moduli.c,v 1.29 2014/08/21 01:08:52 doug Exp $ */
/*
* Copyright 1994 Phil Karn <karn at qualcomm.com>
* Copyright 1996-1998, 2003 William Allen Simpson <wsimpson at greendragon.com>
@@ -461,6 +461,7 @@ write_checkpoint(char *cpfile, u_int32_t lineno)
}
if ((fp = fdopen(r, "w")) == NULL) {
logit("write_checkpoint: fdopen: %s", strerror(errno));
+ unlink(tmp);
close(r);
return;
}
diff --git a/ssh-keygen.c b/ssh-keygen.c
index 23058ee..e149eda 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keygen.c,v 1.249 2014/07/03 03:47:27 djm Exp $ */
+/* $OpenBSD: ssh-keygen.c,v 1.250 2014/08/21 01:08:52 doug Exp $ */
/*
* Author: Tatu Ylonen <ylo at cs.hut.fi>
* Copyright (c) 1994 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -967,12 +967,14 @@ do_gen_all_hostkeys(struct passwd *pw)
f = fdopen(fd, "w");
if (f == NULL) {
printf("fdopen %s failed\n", identity_file);
+ close(fd);
key_free(public);
first = 0;
continue;
}
if (!key_write(public, f)) {
fprintf(stderr, "write key failed\n");
+ fclose(f);
key_free(public);
first = 0;
continue;
--
To stop receiving notification emails like this one, please contact
djm at mindrot.org.
More information about the openssh-commits
mailing list