diff options
Diffstat (limited to 'src/HTInit.c')
-rw-r--r-- | src/HTInit.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/HTInit.c b/src/HTInit.c index f6ab32fa..836a3422 100644 --- a/src/HTInit.c +++ b/src/HTInit.c @@ -272,16 +272,14 @@ PRIVATE int ProcessMailcapEntry ARGS2( struct MailcapEntry *, mc) { size_t rawentryalloc = 2000, len; - char *rawentry, *s, *t, *LineBuf; + char *rawentry, *s, *t; + char *LineBuf = NULL; - LineBuf = (char *)malloc(LINE_BUF_SIZE); - if (!LineBuf) - ExitWithError(MEMORY_EXHAUSTED_ABORT); rawentry = (char *)malloc(1 + rawentryalloc); if (!rawentry) ExitWithError(MEMORY_EXHAUSTED_ABORT); *rawentry = '\0'; - while (fgets(LineBuf, LINE_BUF_SIZE, fp)) { + while ((LineBuf = LYSafeGets(LineBuf, fp)) != 0) { if (LineBuf[0] == '#') continue; len = strlen(LineBuf); @@ -304,8 +302,6 @@ PRIVATE int ProcessMailcapEntry ARGS2( } } - FREE(LineBuf); - s = LYSkipBlanks(rawentry); if (!*s) { /* totally blank entry -- quietly ignore */ |