From b5bcfbf59a39f3f65e87a2c658c21193c6a77bae Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 1 Dec 2000 05:47:28 +0000 Subject: Chip Salzenberg's patch. svn path=/trunk/; revision=2992 --- driver.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'driver.c') 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; -- cgit v1.2.3