(readtoken): Don't leak 64 bytes when reading an empty input stream.

This commit is contained in:
Jim Meyering 2004-03-21 19:50:17 +00:00
parent 9fb05110ea
commit 846d81da01

View File

@ -111,13 +111,14 @@ readtoken (FILE *stream,
i = 0;
for (;;)
{
if (c < 0 && i == 0)
return -1;
if (i == n)
p = x2nrealloc (p, &n, sizeof *p);
if (c < 0)
{
if (i == 0)
return -1;
p[i] = 0;
break;
}