aboutsummaryrefslogtreecommitdiffstats
path: root/driver.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2000-12-01 05:47:28 +0000
committerEric S. Raymond <esr@thyrsus.com>2000-12-01 05:47:28 +0000
commitb5bcfbf59a39f3f65e87a2c658c21193c6a77bae (patch)
treee90d30b1a9b1e90db810133499a272fc688797d9 /driver.c
parent32833fe55b36b1b310901a26177a779d67176f1e (diff)
downloadfetchmail-b5bcfbf59a39f3f65e87a2c658c21193c6a77bae.tar.gz
fetchmail-b5bcfbf59a39f3f65e87a2c658c21193c6a77bae.tar.bz2
fetchmail-b5bcfbf59a39f3f65e87a2c658c21193c6a77bae.zip
Chip Salzenberg's patch.
svn path=/trunk/; revision=2992
Diffstat (limited to 'driver.c')
-rw-r--r--driver.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/driver.c b/driver.c
index 39a20ab3..f6d34e2d 100644
--- a/driver.c
+++ b/driver.c
@@ -740,14 +740,16 @@ static int readheaders(int sock,
}
else
{
+ char *newhdrs;
int newlen;
newlen = oldlen + strlen(line);
- msgblk.headers = (char *) realloc(msgblk.headers, newlen + 1);
- if (msgblk.headers == NULL) {
+ newhdrs = (char *) realloc(msgblk.headers, newlen + 1);
+ if (newhdrs == NULL) {
free(line);
return(PS_IOERR);
}
+ msgblk.headers = newhdrs;
strcpy(msgblk.headers + oldlen, line);
free(line);
line = msgblk.headers + oldlen;