summaryrefslogtreecommitdiff
path: root/clientloop.c
diff options
context:
space:
mode:
authormmcc@openbsd.org <mmcc@openbsd.org>2015-10-20 03:36:35 +0000
committerDamien Miller <djm@mindrot.org>2015-10-25 11:42:03 +1100
commitf98a09cacff7baad8748c9aa217afd155a4d493f (patch)
tree3ed17a7a6de78979338316b4be8712803469db53 /clientloop.c
parentac908c1eeacccfa85659594d92428659320fd57e (diff)
upstream commit
Replace a function-local allocation with stack memory. ok djm@ Upstream-ID: c09fbbab637053a2ab9f33ca142b4e20a4c5a17e
Diffstat (limited to 'clientloop.c')
-rw-r--r--clientloop.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/clientloop.c b/clientloop.c
index 87ceb3dab..1e05cba2e 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: clientloop.c,v 1.275 2015/07/10 06:21:53 markus Exp $ */ 1/* $OpenBSD: clientloop.c,v 1.276 2015/10/20 03:36:35 mmcc Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -311,11 +311,10 @@ client_x11_get_proto(const char *display, const char *xauth_path,
311 static char proto[512], data[512]; 311 static char proto[512], data[512];
312 FILE *f; 312 FILE *f;
313 int got_data = 0, generated = 0, do_unlink = 0, i; 313 int got_data = 0, generated = 0, do_unlink = 0, i;
314 char *xauthdir, *xauthfile; 314 char xauthdir[PATH_MAX] = "", xauthfile[PATH_MAX] = "";
315 struct stat st; 315 struct stat st;
316 u_int now, x11_timeout_real; 316 u_int now, x11_timeout_real;
317 317
318 xauthdir = xauthfile = NULL;
319 *_proto = proto; 318 *_proto = proto;
320 *_data = data; 319 *_data = data;
321 proto[0] = data[0] = '\0'; 320 proto[0] = data[0] = '\0';
@@ -343,8 +342,6 @@ client_x11_get_proto(const char *display, const char *xauth_path,
343 display = xdisplay; 342 display = xdisplay;
344 } 343 }
345 if (trusted == 0) { 344 if (trusted == 0) {
346 xauthdir = xmalloc(PATH_MAX);
347 xauthfile = xmalloc(PATH_MAX);
348 mktemp_proto(xauthdir, PATH_MAX); 345 mktemp_proto(xauthdir, PATH_MAX);
349 /* 346 /*
350 * The authentication cookie should briefly outlive 347 * The authentication cookie should briefly outlive
@@ -407,8 +404,6 @@ client_x11_get_proto(const char *display, const char *xauth_path,
407 unlink(xauthfile); 404 unlink(xauthfile);
408 rmdir(xauthdir); 405 rmdir(xauthdir);
409 } 406 }
410 free(xauthdir);
411 free(xauthfile);
412 407
413 /* 408 /*
414 * If we didn't get authentication data, just make up some 409 * If we didn't get authentication data, just make up some