aboutsummaryrefslogtreecommitdiffstats
path: root/checkalias.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1998-10-08 05:31:22 +0000
committerEric S. Raymond <esr@thyrsus.com>1998-10-08 05:31:22 +0000
commit632f1335893998041f66a25d3809ad719f8557b7 (patch)
tree4530ed420648800a93d1ccded966c7ef941eb3a6 /checkalias.c
parente5cbf59f31c46a8da51b71b16674474be9fe319b (diff)
downloadfetchmail-632f1335893998041f66a25d3809ad719f8557b7.tar.gz
fetchmail-632f1335893998041f66a25d3809ad719f8557b7.tar.bz2
fetchmail-632f1335893998041f66a25d3809ad719f8557b7.zip
Use alloca where possible.
svn path=/trunk/; revision=2076
Diffstat (limited to 'checkalias.c')
-rw-r--r--checkalias.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/checkalias.c b/checkalias.c
index eb045e37..275e9410 100644
--- a/checkalias.c
+++ b/checkalias.c
@@ -13,6 +13,13 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
+#if defined(HAVE_ALLOCA_H)
+#include <alloca.h>
+#else
+#ifdef _AIX
+ #pragma alloca
+#endif
+#endif
#include "mx.h"
#include "fetchmail.h"
@@ -48,7 +55,7 @@ static int is_ip_alias(const char *name1,const char *name2)
{
struct in_addr in;
(void) memcpy(&in.s_addr, *p, sizeof (in.s_addr));
- host_a_addr = (address_e *)xmalloc(sizeof( address_e));
+ host_a_addr = (address_e *)alloca(sizeof( address_e));
memset (host_a_addr,0, sizeof (address_e));
host_a_addr->next = dummy_addr;
(void) memcpy(&host_a_addr->address, *p, sizeof (in.s_addr));
@@ -62,7 +69,7 @@ static int is_ip_alias(const char *name1,const char *name2)
{
struct in_addr in;
(void) memcpy(&in.s_addr, *p, sizeof (in.s_addr));
- host_b_addr = (address_e *)xmalloc(sizeof( address_e));
+ host_b_addr = (address_e *)alloca(sizeof( address_e));
memset (host_b_addr,0, sizeof (address_e));
host_b_addr->next = dummy_addr;
(void) memcpy(&host_b_addr->address, *p, sizeof (in.s_addr));
@@ -121,7 +128,7 @@ int is_host_alias(const char *name, struct query *ctl)
#else
/*
* The only code that calls the BIND library is here and in the
- * start-of-run probe with gethostbyname(3).
+ * start-of-run probe with gethostbyname(3) under ETRN/Kerberos.
*
* We know DNS service was up at the beginning of the run.
* If it's down, our nameserver has crashed. We don't want to try