aboutsummaryrefslogtreecommitdiffstats
path: root/sink.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1998-10-20 04:33:28 +0000
committerEric S. Raymond <esr@thyrsus.com>1998-10-20 04:33:28 +0000
commit42eddaeaf36d467074f329599193030c3beba8ba (patch)
tree3f271d26a6eb861fefd0a384f3e11b8e965833aa /sink.c
parent3299270c28441b9d01a24da727eeaa6553c4d7aa (diff)
downloadfetchmail-42eddaeaf36d467074f329599193030c3beba8ba.tar.gz
fetchmail-42eddaeaf36d467074f329599193030c3beba8ba.tar.bz2
fetchmail-42eddaeaf36d467074f329599193030c3beba8ba.zip
Make alloca safe.
svn path=/trunk/; revision=2115
Diffstat (limited to 'sink.c')
-rw-r--r--sink.c11
1 files changed, 3 insertions, 8 deletions
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 <unistd.h>
#endif
-#if defined(HAVE_ALLOCA_H)
-#include <alloca.h>
-#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);