summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/authfile.c
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2003-09-18 07:56:05 +0000
committermarkus <markus@openbsd.org>2003-09-18 07:56:05 +0000
commit4ebc8a59a2565b503ec8e5fd7dfb2273e429c120 (patch)
tree529957c600877c568cfacc66894cb79886911bdb /usr.bin/ssh/authfile.c
parentprotect against double free; #660; zardoz at users.sf.net (diff)
downloadwireguard-openbsd-4ebc8a59a2565b503ec8e5fd7dfb2273e429c120.tar.xz
wireguard-openbsd-4ebc8a59a2565b503ec8e5fd7dfb2273e429c120.zip
missing buffer_free(&encrypted); #662; zardoz at users.sf.net
Diffstat (limited to 'usr.bin/ssh/authfile.c')
-rw-r--r--usr.bin/ssh/authfile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/ssh/authfile.c b/usr.bin/ssh/authfile.c
index 6133ec1f67f..a7174398343 100644
--- a/usr.bin/ssh/authfile.c
+++ b/usr.bin/ssh/authfile.c
@@ -36,7 +36,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: authfile.c,v 1.54 2003/05/24 09:30:39 djm Exp $");
+RCSID("$OpenBSD: authfile.c,v 1.55 2003/09/18 07:56:05 markus Exp $");
#include <openssl/err.h>
#include <openssl/evp.h>
@@ -143,6 +143,7 @@ key_save_private_rsa1(Key *key, const char *filename, const char *passphrase,
fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0600);
if (fd < 0) {
error("open %s failed: %s.", filename, strerror(errno));
+ buffer_free(&encrypted);
return 0;
}
if (write(fd, buffer_ptr(&encrypted), buffer_len(&encrypted)) !=