diff --git a/tail.c b/tail.c index 3ea4739..b97ed5c 100644 --- a/tail.c +++ b/tail.c @@ -101,13 +101,12 @@ main(int argc, char *argv[]) tail(fp, argv[0], n); if (fflag && argc == 1) { - for(;; tmp = NULL, tmpsize = 0) { + tmp = NULL; + tmpsize = 0; + for(;;) { while (getline(&tmp, &tmpsize, fp) != -1) { fputs(tmp, stdout); fflush(stdout); - free(tmp); - tmp = NULL; - tmpsize = 0; } if (ferror(fp)) eprintf("readline '%s':", argv[0]);