diff options
author | avatar <avatar@FreeBSD.org> | 2007-11-22 01:51:46 +0000 |
---|---|---|
committer | avatar <avatar@FreeBSD.org> | 2007-11-22 01:51:46 +0000 |
commit | 5fe104598e52f3420ed1a06628822037577d6f88 (patch) | |
tree | d5f0cbfddb59ef604b4a36dcf44a54e95b6a2dc3 | |
parent | 018efe29f979fab10b25b6928fe98cfde2fe5a80 (diff) | |
download | FreeBSD-src-5fe104598e52f3420ed1a06628822037577d6f88.zip FreeBSD-src-5fe104598e52f3420ed1a06628822037577d6f88.tar.gz |
Nuking the temporary pointer once it is properly tracked in local storage.
This should fix the double free() bug where there's no tailing newline(\n)
character:
current# echo -n test | tail
testAssertion failed: (run->magic == ARENA_RUN_MAGIC), function
arena_dalloc, file /usr/src/lib/libc/stdlib/malloc.c, line 2448.
Abort (core dumped)
Reviewed by: kib
MFC after: 3 days
-rw-r--r-- | usr.bin/tail/read.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/usr.bin/tail/read.c b/usr.bin/tail/read.c index 272f102..d290ed4 100644 --- a/usr.bin/tail/read.c +++ b/usr.bin/tail/read.c @@ -184,6 +184,7 @@ lines(FILE *fp, off_t off) } if (cnt) { llines[recno].l = sp; + sp = NULL; llines[recno].len = cnt; if (++recno == off) { wrap = 1; |