diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1998-10-08 05:31:22 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1998-10-08 05:31:22 +0000 |
commit | 632f1335893998041f66a25d3809ad719f8557b7 (patch) | |
tree | 4530ed420648800a93d1ccded966c7ef941eb3a6 /pop3.c | |
parent | e5cbf59f31c46a8da51b71b16674474be9fe319b (diff) | |
download | fetchmail-632f1335893998041f66a25d3809ad719f8557b7.tar.gz fetchmail-632f1335893998041f66a25d3809ad719f8557b7.tar.bz2 fetchmail-632f1335893998041f66a25d3809ad719f8557b7.zip |
Use alloca where possible.
svn path=/trunk/; revision=2076
Diffstat (limited to 'pop3.c')
-rw-r--r-- | pop3.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -7,6 +7,13 @@ #include "config.h" #ifdef POP3_ENABLE #include <stdio.h> +#if defined(HAVE_ALLOCA_H) +#include <alloca.h> +#else +#ifdef _AIX + #pragma alloca +#endif +#endif #include <string.h> #include <ctype.h> #if defined(HAVE_UNISTD_H) @@ -218,12 +225,11 @@ int pop3_getauth(int sock, struct query *ctl, char *greeting) *++end = '\0'; /* copy timestamp and password into digestion buffer */ - msg = (char *)xmalloc((end-start+1) + strlen(ctl->password) + 1); + msg = (char *)alloca((end-start+1) + strlen(ctl->password) + 1); strcpy(msg,start); strcat(msg,ctl->password); strcpy(ctl->digest, MD5Digest(msg)); - free(msg); ok = gen_transact(sock, "APOP %s %s", ctl->remotename, ctl->digest); break; |