From 632f1335893998041f66a25d3809ad719f8557b7 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 8 Oct 1998 05:31:22 +0000 Subject: Use alloca where possible. svn path=/trunk/; revision=2076 --- checkalias.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'checkalias.c') diff --git a/checkalias.c b/checkalias.c index eb045e37..275e9410 100644 --- a/checkalias.c +++ b/checkalias.c @@ -13,6 +13,13 @@ #include #include #include +#if defined(HAVE_ALLOCA_H) +#include +#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 -- cgit v1.2.3