summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh
diff options
context:
space:
mode:
authormmcc <mmcc@openbsd.org>2015-10-20 03:36:35 +0000
committermmcc <mmcc@openbsd.org>2015-10-20 03:36:35 +0000
commitdf8a658fd957f9ed8bddfb21702a930d25f1136b (patch)
tree1496637175209349165d9db1af47730be457fd40 /usr.bin/ssh
parentIn order to become able to generate syntax tree nodes on the roff(7) (diff)
downloadwireguard-openbsd-df8a658fd957f9ed8bddfb21702a930d25f1136b.tar.xz
wireguard-openbsd-df8a658fd957f9ed8bddfb21702a930d25f1136b.zip
Replace a function-local allocation with stack memory.
ok djm@
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r--usr.bin/ssh/clientloop.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/usr.bin/ssh/clientloop.c b/usr.bin/ssh/clientloop.c
index 4c561df1aca..000b80710c4 100644
--- a/usr.bin/ssh/clientloop.c
+++ b/usr.bin/ssh/clientloop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clientloop.c,v 1.275 2015/07/10 06:21:53 markus Exp $ */
+/* $OpenBSD: clientloop.c,v 1.276 2015/10/20 03:36:35 mmcc Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -303,11 +303,10 @@ client_x11_get_proto(const char *display, const char *xauth_path,
static char proto[512], data[512];
FILE *f;
int got_data = 0, generated = 0, do_unlink = 0, i;
- char *xauthdir, *xauthfile;
+ char xauthdir[PATH_MAX] = "", xauthfile[PATH_MAX] = "";
struct stat st;
u_int now, x11_timeout_real;
- xauthdir = xauthfile = NULL;
*_proto = proto;
*_data = data;
proto[0] = data[0] = '\0';
@@ -335,8 +334,6 @@ client_x11_get_proto(const char *display, const char *xauth_path,
display = xdisplay;
}
if (trusted == 0) {
- xauthdir = xmalloc(PATH_MAX);
- xauthfile = xmalloc(PATH_MAX);
mktemp_proto(xauthdir, PATH_MAX);
/*
* The authentication cookie should briefly outlive
@@ -399,8 +396,6 @@ client_x11_get_proto(const char *display, const char *xauth_path,
unlink(xauthfile);
rmdir(xauthdir);
}
- free(xauthdir);
- free(xauthfile);
/*
* If we didn't get authentication data, just make up some