From 42eddaeaf36d467074f329599193030c3beba8ba Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 20 Oct 1998 04:33:28 +0000 Subject: Make alloca safe. svn path=/trunk/; revision=2115 --- sink.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'sink.c') diff --git a/sink.c b/sink.c index 8b372d36..90af32ed 100644 --- a/sink.c +++ b/sink.c @@ -24,13 +24,6 @@ #if defined(HAVE_UNISTD_H) #include #endif -#if defined(HAVE_ALLOCA_H) -#include -#else -#ifdef _AIX - #pragma alloca -#endif -#endif #include "fetchmail.h" #include "socket.h" @@ -96,13 +89,15 @@ static int smtp_open(struct query *ctl) set_timeout(ctl->server.timeout); for (idp = ctl->smtphunt; idp; idp = idp->next) { - char *cp, *parsed_host = alloca(strlen(idp->id) + 1); + char *cp, *parsed_host; #ifdef INET6 char *portnum = SMTP_PORT; #else int portnum = SMTP_PORT; #endif /* INET6 */ + xalloca(parsed_host, char *, strlen(idp->id) + 1); + ctl->smtphost = idp->id; /* remember last host tried. */ strcpy(parsed_host, idp->id); -- cgit v1.2.3