From 6cc9acfd6170f2fa497878dd89cece62c2967d17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Thu, 13 Feb 2020 16:55:41 +0100 Subject: [PATCH] * src/netrc.c (search_netrc): Remove use of alloca --- src/netrc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/netrc.c b/src/netrc.c index 5f9d85e1..c48327ef 100644 --- a/src/netrc.c +++ b/src/netrc.c @@ -111,11 +111,10 @@ search_netrc (const char *host, const char **acc, const char **passwd, else if (opt.homedir) { struct stat buf; - char *path = (char *)alloca (strlen (opt.homedir) + 1 - + strlen (NETRC_FILE_NAME) + 1); - sprintf (path, "%s/%s", opt.homedir, NETRC_FILE_NAME); + char *path = aprintf ("%s/%s", opt.homedir, NETRC_FILE_NAME); if (stat (path, &buf) == 0) netrc_list = parse_netrc (path); + xfree (path); } #endif /* def __VMS [else] */